File tree Expand file tree Collapse file tree 12 files changed +102
-25
lines changed
packages/react-native/Libraries Expand file tree Collapse file tree 12 files changed +102
-25
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ module.exports = {
74
74
'lint/no-haste-imports' : 2 ,
75
75
'lint/no-react-native-imports' : 2 ,
76
76
'lint/require-extends-error' : 2 ,
77
+ 'lint/no-react-node-imports' : 2 ,
77
78
} ,
78
79
} ,
79
80
{
Original file line number Diff line number Diff line change @@ -15,17 +15,18 @@ import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
15
15
import type {
16
16
BlurEvent ,
17
17
FocusEvent ,
18
+ GestureResponderEvent ,
18
19
LayoutChangeEvent ,
19
20
LayoutRectangle ,
20
21
MouseEvent ,
21
22
PointerEvent ,
22
- GestureResponderEvent ,
23
23
} from '../../Types/CoreEventTypes' ;
24
24
import type {
25
25
AccessibilityActionEvent ,
26
26
AccessibilityProps ,
27
27
} from './ViewAccessibility' ;
28
- import type { Node } from 'react' ;
28
+
29
+ import React from 'react' ;
29
30
30
31
export type ViewLayout = LayoutRectangle ;
31
32
export type ViewLayoutEvent = LayoutChangeEvent ;
@@ -357,7 +358,7 @@ export type ViewPropsIOS = $ReadOnly<{
357
358
} > ;
358
359
359
360
type ViewBaseProps = $ReadOnly < {
360
- children ?: Node ,
361
+ children ?: React . Node ,
361
362
style ?: ?ViewStyleProp ,
362
363
363
364
/**
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ import type {
24
24
import typeof Image from './Image' ;
25
25
import type { ImageResizeMode } from './ImageResizeMode' ;
26
26
import type { ImageSource , ImageURISource } from './ImageSource' ;
27
- import type { ElementRef , Node , RefSetter } from 'react' ;
27
+ import type React from 'react' ;
28
+ import type { ElementRef , RefSetter } from 'react' ;
28
29
29
30
export type ImageSourcePropType = ImageSource ;
30
31
@@ -341,7 +342,7 @@ export type ImageProps = $ReadOnly<{
341
342
342
343
export type ImageBackgroundProps = $ReadOnly < {
343
344
...ImageProps ,
344
- children ?: Node ,
345
+ children ?: React . Node ,
345
346
346
347
/**
347
348
* Style applied to the outer View component
Original file line number Diff line number Diff line change 8
8
* @format
9
9
*/
10
10
11
- import type { Node } from 'react' ;
12
-
13
11
import StyleSheet from '../../StyleSheet/StyleSheet' ;
14
12
import Text from '../../Text/Text' ;
15
13
import Platform from '../../Utilities/Platform' ;
@@ -21,7 +19,7 @@ const styles = StyleSheet.create({
21
19
} ,
22
20
} ) ;
23
21
24
- const DebugInstructions : ( ) => Node = Platform . select ( {
22
+ const DebugInstructions : ( ) => React . Node = Platform . select ( {
25
23
ios : ( ) => (
26
24
< Text >
27
25
Press < Text style = { styles . highlight } > Cmd + D</ Text > in the simulator or{ ' ' }
Original file line number Diff line number Diff line change 8
8
* @format
9
9
*/
10
10
11
- import type { Node } from 'react' ;
12
-
13
11
import ImageBackground from '../../Image/ImageBackground' ;
14
12
import StyleSheet from '../../StyleSheet/StyleSheet' ;
15
13
import Text from '../../Text/Text' ;
@@ -18,7 +16,7 @@ import Colors from './Colors';
18
16
import HermesBadge from './HermesBadge' ;
19
17
import React from 'react' ;
20
18
21
- const Header = ( ) : Node => {
19
+ const Header = ( ) : React . Node => {
22
20
const isDarkMode = useColorScheme ( ) === 'dark' ;
23
21
return (
24
22
< ImageBackground
Original file line number Diff line number Diff line change 8
8
* @format
9
9
*/
10
10
11
- import type { Node } from 'react' ;
12
-
13
11
import View from '../../Components/View/View' ;
14
12
import StyleSheet from '../../StyleSheet/StyleSheet' ;
15
13
import Text from '../../Text/Text' ;
16
14
import useColorScheme from '../../Utilities/useColorScheme' ;
17
15
import Colors from './Colors' ;
18
16
import React from 'react' ;
19
17
20
- const HermesBadge = ( ) : Node => {
18
+ const HermesBadge = ( ) : React . Node => {
21
19
const isDarkMode = useColorScheme ( ) === 'dark' ;
22
20
const version =
23
21
global . HermesInternal ?. getRuntimeProperties ?. ( ) [ 'OSS Release Version' ] ??
Original file line number Diff line number Diff line change 8
8
* @format
9
9
*/
10
10
11
- import type { Node } from 'react' ;
12
-
13
11
import TouchableOpacity from '../../Components/Touchable/TouchableOpacity' ;
14
12
import View from '../../Components/View/View' ;
15
13
import openURLInBrowser from '../../Core/Devtools/openURLInBrowser' ;
@@ -81,7 +79,7 @@ const links = [
81
79
} ,
82
80
] ;
83
81
84
- const LinkList = ( ) : Node => {
82
+ const LinkList = ( ) : React . Node => {
85
83
const isDarkMode = useColorScheme ( ) === 'dark' ;
86
84
return (
87
85
< View style = { styles . container } >
Original file line number Diff line number Diff line change 8
8
* @format
9
9
*/
10
10
11
- import type { Node } from 'react' ;
12
-
13
11
import StyleSheet from '../../StyleSheet/StyleSheet' ;
14
12
import Text from '../../Text/Text' ;
15
13
import Platform from '../../Utilities/Platform' ;
@@ -21,7 +19,7 @@ const styles = StyleSheet.create({
21
19
} ,
22
20
} ) ;
23
21
24
- const ReloadInstructions : ( ) => Node = Platform . select ( {
22
+ const ReloadInstructions : ( ) => React . Node = Platform . select ( {
25
23
ios : ( ) => (
26
24
< Text >
27
25
Press < Text style = { styles . highlight } > Cmd + R</ Text > in the simulator to
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ import type {
24
24
PointerEvent ,
25
25
TextLayoutEvent ,
26
26
} from '../Types/CoreEventTypes' ;
27
- import type { Node } from 'react' ;
27
+
28
+ import React from 'react' ;
28
29
29
30
export type PressRetentionOffset = $ReadOnly < {
30
31
top : number ,
@@ -169,7 +170,7 @@ type TextBaseProps = $ReadOnly<{
169
170
*/
170
171
'aria-labelledby' ?: ?string ,
171
172
172
- children ?: ?Node ,
173
+ children ?: ?React . Node ,
173
174
174
175
/**
175
176
* When `numberOfLines` is set, this prop defines how text will be
Original file line number Diff line number Diff line change @@ -4035,7 +4035,7 @@ export type ViewPropsIOS = $ReadOnly<{
4035
4035
shouldRasterizeIOS?: ?boolean,
4036
4036
}>;
4037
4037
type ViewBaseProps = $ReadOnly<{
4038
- children?: Node,
4038
+ children?: React. Node,
4039
4039
style?: ?ViewStyleProp,
4040
4040
collapsable?: ?boolean,
4041
4041
collapsableChildren?: ?boolean,
@@ -4679,7 +4679,7 @@ export type ImageProps = $ReadOnly<{
4679
4679
}>;
4680
4680
export type ImageBackgroundProps = $ReadOnly<{
4681
4681
...ImageProps,
4682
- children?: Node,
4682
+ children?: React. Node,
4683
4683
style?: ?ViewStyleProp,
4684
4684
imageStyle?: ?ImageStyleProp,
4685
4685
imageRef?: RefSetter<ElementRef<Image>>,
@@ -8136,7 +8136,7 @@ type TextBaseProps = $ReadOnly<{
8136
8136
\\"aria-expanded\\"?: ?boolean,
8137
8137
\\"aria-selected\\"?: ?boolean,
8138
8138
\\"aria-labelledby\\"?: ?string,
8139
- children?: ?Node,
8139
+ children?: ?React. Node,
8140
8140
ellipsizeMode?: ?(\\"clip\\" | \\"head\\" | \\"middle\\" | \\"tail\\"),
8141
8141
id?: string,
8142
8142
maxFontSizeMultiplier?: ?number,
You can’t perform that action at this time.
0 commit comments