diff --git a/lib/react.js b/lib/react.js index 602779efe0d..ee710a38a22 100644 --- a/lib/react.js +++ b/lib/react.js @@ -258,6 +258,12 @@ declare module react { declare export var ConcurrentMode: ({children: ?React$Node}) => React$Node; // 16.7+ declare export var StrictMode: ({children: ?React$Node}) => React$Node; + declare export var Suspense: React$ComponentType<{ + children?: ?React$Node, + fallback: React$Node, + maxDuration?: number + }>; // 16.6+ + declare export type ElementProps = React$ElementProps; declare export type ElementConfig = React$ElementConfig; declare export type ElementRef = React$ElementRef; @@ -353,6 +359,7 @@ declare module react { +Children: typeof Children, +ConcurrentMode: typeof ConcurrentMode, +StrictMode: typeof StrictMode, + +Suspense: typeof Suspense, +useContext: typeof useContext, +useState: typeof useState, +useReducer: typeof useReducer, diff --git a/tests/getters_and_setters/getters_and_setters.exp b/tests/getters_and_setters/getters_and_setters.exp index b6aa03a7300..455166debdb 100644 --- a/tests/getters_and_setters/getters_and_setters.exp +++ b/tests/getters_and_setters/getters_and_setters.exp @@ -465,8 +465,13 @@ References: react.js:17:13 17| (); // error: number ~> string ^^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -482,8 +487,13 @@ References: react.js:18:20 18| (); // error: number ~> string ^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] diff --git a/tests/new_react/new_react.exp b/tests/new_react/new_react.exp index 65cc8b33c78..e3a90c4731a 100644 --- a/tests/new_react/new_react.exp +++ b/tests/new_react/new_react.exp @@ -189,8 +189,13 @@ Cannot assign `this.props.x` to `_` because number [1] is incompatible with stri ^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] classes.js:57:12 57| var _: string = this.props.x; @@ -388,8 +393,13 @@ Cannot assign `this.props.z` to `qux` because: ^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] new_react.js:19:18 19| var qux: string = this.props.z; @@ -405,8 +415,13 @@ Cannot assign `this.props.x` to `w` because string [1] is incompatible with numb ^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] new_react.js:20:15 20| var w:number = this.props.x; @@ -439,8 +454,13 @@ References: new_react.js:29:23 29| var element = ; ^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -545,8 +565,13 @@ Cannot assign `this.props.x` to `a` because: ^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] props.js:14:16 14| var a: number = this.props.x; // error @@ -582,8 +607,13 @@ Cannot assign `this.props.z` to `c` because: ^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] props.js:16:16 16| var c: string = this.props.z; // error @@ -604,14 +634,24 @@ References: props.js:20:29 20| var element = ; // 3 errors ^^^^^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] props.js:20:49 20| var element = ; // 3 errors ^^^^^ [3] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [4] @@ -668,8 +708,13 @@ References: props2.js:9:41 9| getInitialState: function(): { bar: number } { ^^^^^^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] props2.js:15:42 15| return ; @@ -700,12 +745,21 @@ Cannot get `React.PropTypes.string.inRequired` because property `inRequired` is ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:380:39 v 380| type ReactPropsChainableTypeChecker = { 381| isRequired: ReactPropsCheckType; 382| (props: any, propName: string, componentName: string, href?: string): ?Error; 383| }; +======= + /react.js:379:39 + v + 379| type ReactPropsChainableTypeChecker = { + 380| isRequired: ReactPropsCheckType; + 381| (props: any, propName: string, componentName: string, href?: string): ?Error; + 382| }; +>>>>>>> Add React.Suspense component and tests ^ [1] diff --git a/tests/react/react.exp b/tests/react/react.exp index d7c7910bdfa..ee3f1b4b9f3 100644 --- a/tests/react/react.exp +++ b/tests/react/react.exp @@ -80,8 +80,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:7:22 7| (this.props.foo: empty); // error: string ~> empty @@ -97,8 +102,13 @@ Cannot cast `this.props.bar` to empty because number [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:8:22 8| (this.props.bar: empty); // error: number ~> empty @@ -251,8 +261,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:117:22 117| (this.props.foo: empty); // string ~> empty @@ -268,8 +283,13 @@ Cannot cast `this.state.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:118:22 118| (this.state.foo: empty); // string ~> empty @@ -285,8 +305,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:133:22 133| (this.props.foo: empty); // string ~> empty @@ -302,8 +327,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:137:22 137| (this.props.foo: empty); // string ~> empty @@ -319,8 +349,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:141:22 141| (this.props.foo: empty); // string ~> empty @@ -336,8 +371,13 @@ Cannot cast `nextProps.foo` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:142:21 142| (nextProps.foo: empty); // string ~> empty @@ -353,8 +393,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:146:22 146| (this.props.foo: empty); // string ~> empty @@ -387,8 +432,13 @@ Cannot cast `nextProps.foo` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:148:21 148| (nextProps.foo: empty); // string ~> empty @@ -435,8 +485,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:153:22 153| (this.props.foo: empty); // string ~> empty @@ -469,8 +524,13 @@ Cannot cast `nextProps.foo` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:155:21 155| (nextProps.foo: empty); // string ~> empty @@ -503,8 +563,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:160:22 160| (this.props.foo: empty); // string ~> empty @@ -537,8 +602,13 @@ Cannot cast `nextProps.foo` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:162:21 162| (nextProps.foo: empty); // string ~> empty @@ -571,8 +641,13 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] create_class.js:167:22 167| (this.props.foo: empty); // string ~> empty @@ -1904,8 +1979,13 @@ References: jsx_spread.js:10:19 10| var props = {bar: 42}; ^^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -2018,8 +2098,13 @@ References: proptype_arrayOf.js:15:45 15| var fail_mistyped_elems = ^^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -2035,8 +2120,13 @@ References: proptype_arrayOf.js:20:36 20| var todo_required = ^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -2053,8 +2143,13 @@ References: proptype_arrayOf.js:30:25 30| (); // error: string ~> number ^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -2092,8 +2187,13 @@ Cannot cast `propName` to empty because string [1] is incompatible with empty [2 ^^^^^^^^ References: +<<<<<<< HEAD /react.js:376:13 376| propName: string, +======= + /react.js:375:13 + 375| propName: string, +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] proptype_custom_validator.js:8:18 8| (propName: empty); // error: propName is a string @@ -2109,8 +2209,13 @@ Cannot cast `componentName` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:377:18 377| componentName: string, +======= + /react.js:376:18 + 376| componentName: string, +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] proptype_custom_validator.js:9:23 9| (componentName: empty); // error: componentName is a string @@ -2128,8 +2233,13 @@ Cannot cast `href` to empty because: ^^^^ References: +<<<<<<< HEAD /react.js:378:10 378| href?: string) => ?Error; +======= + /react.js:377:10 + 377| href?: string) => ?Error; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] proptype_custom_validator.js:10:14 10| (href: empty); // error: href is an optional string @@ -2148,8 +2258,13 @@ References: proptype_custom_validator.js:11:18 11| return (0: mixed); // error: should return ?Error ^^^^^ [1] +<<<<<<< HEAD /react.js:378:22 378| href?: string) => ?Error; +======= + /react.js:377:22 + 377| href?: string) => ?Error; +>>>>>>> Add React.Suspense component and tests ^^^^^ [2] @@ -2242,8 +2357,13 @@ References: proptype_objectOf.js:15:47 15| var fail_mistyped_props = ^^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -2259,8 +2379,13 @@ References: proptype_objectOf.js:20:38 20| var todo_required = ^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -2276,8 +2401,13 @@ References: proptype_objectOf.js:30:27 30| (); // error: string ~> number ^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -2452,11 +2582,19 @@ References: proptype_oneOfType.js:24:32 24| var fail_bool = ; ^^^^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; ^^^^^^ [2] /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; + ^^^^^^ [2] + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [3] @@ -2474,11 +2612,19 @@ References: proptype_oneOfType.js:29:36 29| var todo_required = ; ^^^^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; ^^^^^^ [2] /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; + ^^^^^^ [2] + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [3] @@ -2494,8 +2640,13 @@ References: proptype_oneOfType.js:41:22 41| (); // error: number ~> string ^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -2577,14 +2728,24 @@ Cannot cast `React.PropTypes.arrayOf` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:386:17 386| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; +======= + /react.js:385:17 + 385| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] +<<<<<<< HEAD /react.js:386:41 386| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; +======= + /react.js:385:41 + 385| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2601,8 +2762,13 @@ empty [2] in the return value. ^^^^^^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:388:27 388| (expectedClass: any) => ReactPropsChainableTypeChecker; +======= + /react.js:387:27 + 387| (expectedClass: any) => ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2620,14 +2786,24 @@ Cannot cast `React.PropTypes.objectOf` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:390:17 390| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; +======= + /react.js:389:17 + 389| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] +<<<<<<< HEAD /react.js:390:41 390| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; +======= + /react.js:389:41 + 389| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2645,14 +2821,24 @@ Cannot cast `React.PropTypes.oneOf` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:392:20 392| (expectedValues: Array) => ReactPropsChainableTypeChecker; +======= + /react.js:391:20 + 391| (expectedValues: Array) => ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] +<<<<<<< HEAD /react.js:392:35 392| (expectedValues: Array) => ReactPropsChainableTypeChecker; +======= + /react.js:391:35 + 391| (expectedValues: Array) => ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2670,14 +2856,24 @@ Cannot cast `React.PropTypes.oneOfType` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:394:25 394| (arrayOfTypeCheckers: Array) => +======= + /react.js:393:25 + 393| (arrayOfTypeCheckers: Array) => +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] +<<<<<<< HEAD /react.js:395:5 395| ReactPropsChainableTypeChecker; +======= + /react.js:394:5 + 394| ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2695,14 +2891,24 @@ Cannot cast `React.PropTypes.shape` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:397:16 397| (shapeTypes: { [key: string]: ReactPropsCheckType }) => +======= + /react.js:396:16 + 396| (shapeTypes: { [key: string]: ReactPropsCheckType }) => +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] +<<<<<<< HEAD /react.js:398:5 398| ReactPropsChainableTypeChecker; +======= + /react.js:397:5 + 397| ReactPropsChainableTypeChecker; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -3180,12 +3386,21 @@ Cannot call `React.useCallback` because function [1] requires another argument. ^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:320:38 v--- 320| declare export function useCallback( 321| callback: () => T | void, 322| inputs: ?$ReadOnlyArray, 323| ): T; +======= + /react.js:318:38 + v--- + 318| declare export function useCallback( + 319| callback: () => T | void, + 320| inputs: ?$ReadOnlyArray, + 321| ): T; +>>>>>>> Add React.Suspense component and tests ---^ [1] @@ -3216,8 +3431,13 @@ read-only array type [2]. ^^ [1] References: +<<<<<<< HEAD /react.js:322:14 322| inputs: ?$ReadOnlyArray, +======= + /react.js:320:14 + 320| inputs: ?$ReadOnlyArray, +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^ [2] @@ -3226,6 +3446,7 @@ Error -------------------------------------------------------------------------- Cannot call `React.useMutationEffect` because property `useMutationEffect` is missing in object type [1]. useContext_hook.js:6:3 +<<<<<<< HEAD 6| React.useMutationEffect(); // Error: function requires another argument. ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3263,6 +3484,19 @@ References: 364| +useImperativeMethods: typeof useImperativeMethods, 365| |}; -^ [1] +======= + 6| React.useContext(); // Error: function requires another argument. + ^^^^^^^^^^^^^^^^^^ + +References: + /react.js:291:37 + v--- + 291| declare export function useContext( + 292| context: React$Context, + 293| observedBits: void | number | boolean, + 294| ): T; + ---^ [1] +>>>>>>> Add React.Suspense component and tests Error ----------------------------------------------------------------------------------------- useContext_hook.js:21:18 @@ -3346,12 +3580,21 @@ Cannot call `React.useEffect` because function [1] requires another argument. ^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:310:36 v 310| declare export function useEffect( 311| create: () => MaybeCleanUpFn, 312| inputs: ?$ReadOnlyArray, 313| ): void; +======= + /react.js:308:36 + v + 308| declare export function useEffect( + 309| create: () => MaybeCleanUpFn, + 310| inputs: ?$ReadOnlyArray, + 311| ): void; +>>>>>>> Add React.Suspense component and tests ------^ [1] @@ -3364,8 +3607,13 @@ Cannot call `React.useEffect` with `1` bound to `create` because number [1] is i ^ [1] References: +<<<<<<< HEAD /react.js:311:13 311| create: () => MaybeCleanUpFn, +======= + /react.js:309:13 + 309| create: () => MaybeCleanUpFn, +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^ [2] @@ -3379,8 +3627,13 @@ type [2]. ^ [1] References: +<<<<<<< HEAD /react.js:312:14 312| inputs: ?$ReadOnlyArray, +======= + /react.js:310:14 + 310| inputs: ?$ReadOnlyArray, +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^ [2] @@ -3393,6 +3646,7 @@ Cannot call `React.useImperativeMethods` because function [1] requires another a ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:330:47 v--- 330| declare export function useImperativeMethods( @@ -3400,6 +3654,15 @@ References: 332| create: () => T, 333| inputs: ?$ReadOnlyArray, 334| ): void; +======= + /react.js:328:47 + v--- + 328| declare export function useImperativeMethods( + 329| ref: {current: T | null} | ((inst: T | null) => mixed) | null | void, + 330| create: () => T, + 331| inputs: ?$ReadOnlyArray, + 332| ): void; +>>>>>>> Add React.Suspense component and tests ------^ [1] @@ -3448,12 +3711,21 @@ Cannot call `React.useLayoutEffect` because function [1] requires another argume ^^^^^^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:315:42 v 315| declare export function useLayoutEffect( 316| create: () => MaybeCleanUpFn, 317| inputs: ?$ReadOnlyArray, 318| ): void; +======= + /react.js:313:42 + v + 313| declare export function useLayoutEffect( + 314| create: () => MaybeCleanUpFn, + 315| inputs: ?$ReadOnlyArray, + 316| ): void; +>>>>>>> Add React.Suspense component and tests ------^ [1] @@ -3467,8 +3739,13 @@ type [2]. ^ [1] References: +<<<<<<< HEAD /react.js:316:13 316| create: () => MaybeCleanUpFn, +======= + /react.js:314:13 + 314| create: () => MaybeCleanUpFn, +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^ [2] @@ -3482,8 +3759,13 @@ type [2]. ^ [1] References: +<<<<<<< HEAD /react.js:317:14 317| inputs: ?$ReadOnlyArray, +======= + /react.js:315:14 + 315| inputs: ?$ReadOnlyArray, +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^^^^^ [2] @@ -3496,12 +3778,21 @@ Cannot call `React.useMemo` because function [1] requires another argument. ^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:325:34 v--- 325| declare export function useMemo( 326| create: () => T, 327| inputs: ?$ReadOnlyArray, 328| ): T; +======= + /react.js:323:34 + v--- + 323| declare export function useMemo( + 324| create: () => T, + 325| inputs: ?$ReadOnlyArray, + 326| ): T; +>>>>>>> Add React.Suspense component and tests ---^ [1] @@ -3927,6 +4218,7 @@ Cannot call `React.useReducer` because function [1] requires another argument. ^^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:302:37 v------ 302| declare export function useReducer( @@ -3934,6 +4226,15 @@ References: 304| initialState: S, 305| initialAction: ?A, 306| ): [S, A => void]; +======= + /react.js:300:37 + v------ + 300| declare export function useReducer( + 301| reducer: (S, A) => S, + 302| initialState: S, + 303| initialAction: ?A, + 304| ): [S, A => void]; +>>>>>>> Add React.Suspense component and tests ----------------^ [1] diff --git a/tests/react_16_6/Suspense.js b/tests/react_16_6/Suspense.js new file mode 100644 index 00000000000..d3da6e059da --- /dev/null +++ b/tests/react_16_6/Suspense.js @@ -0,0 +1,41 @@ +// @flow + +import React from 'react'; + +const {Suspense} = React; + +function Loading() { + return
Loading...
; +} + +{ + // Error: fallback is missing in props +} + +{ + } maxDuration="abc" /> // Error: string is incompatible with number +} + +{ + // Error: function is incompatible with exact React.Element +} + +{ + } /> +} + +{ + }> + + +} + +{ + } maxDuration={1000} /> +} + +{ + } maxDuration={1000}> + + +} \ No newline at end of file diff --git a/tests/react_16_6/react_16_6.exp b/tests/react_16_6/react_16_6.exp index 5b118552ffe..cc7bfffb75d 100644 --- a/tests/react_16_6/react_16_6.exp +++ b/tests/react_16_6/react_16_6.exp @@ -1,3 +1,65 @@ +Error ------------------------------------------------------------------------------------------------- Suspense.js:12:3 + +Cannot create `Suspense` element because property `fallback` is missing in props [1] but exists in object type [2]. + + Suspense.js:12:3 + 12| // Error: fallback is missing in props + ^^^^^^^^^^^^ [1] + +References: + /react.js:253:52 + v + 253| declare export var Suspense: React$ComponentType<{ + 254| children?: ?React$Node, + 255| fallback: React$Node, + 256| maxDuration?: number + 257| }>; // 16.6+ + ^ [2] + + +Error ------------------------------------------------------------------------------------------------- Suspense.js:16:3 + +Cannot create `Suspense` element because string [1] is incompatible with number [2] in property `maxDuration`. + + Suspense.js:16:3 + 16| } maxDuration="abc" /> // Error: string is incompatible with number + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +References: + Suspense.js:16:48 + 16| } maxDuration="abc" /> // Error: string is incompatible with number + ^^^^^ [1] + /react.js:256:19 + 256| maxDuration?: number + ^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------------- Suspense.js:20:3 + +Cannot create `Suspense` element because in property `fallback`: + - Either inexact function [1] is incompatible with exact `React.Element` [2]. + - Or function [1] is incompatible with `React.Portal` [3]. + - Or property `@@iterator` is missing in function [1] but exists in `$Iterable` [4]. + + Suspense.js:20:3 + 20| // Error: function is incompatible with exact React.Element + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +References: + Suspense.js:7:1 + 7| function Loading() { + ^^^^^^^^^^^^^^^^^^ [1] + /react.js:18:5 + 18| | React$Element + ^^^^^^^^^^^^^^^^^^ [2] + /react.js:19:5 + 19| | React$Portal + ^^^^^^^^^^^^ [3] + /react.js:20:5 + 20| | Iterable; + ^^^^^^^^^^^^^^^^^^^^^ [4] + + Error ---------------------------------------------------------------------------------------------------- lazy.js:12:12 Cannot create `LazyFunctionComponent` element because property `foo` is missing in props [1] but exists in `Props` [2]. @@ -179,4 +241,7 @@ References: -Found 12 errors +Found 15 errors + +Only showing the most relevant union/intersection branches. +To see all branches, re-run Flow with --show-all-branches diff --git a/tests/react_children/react_children.exp b/tests/react_children/react_children.exp index 61aa7db4a83..6ea6d75310c 100644 --- a/tests/react_children/react_children.exp +++ b/tests/react_children/react_children.exp @@ -68,8 +68,13 @@ References: api.js:14:25 14| Children.forEach(a, (x: number) => {}); // Error ^^^^^^ [2] +<<<<<<< HEAD /react.js:265:38 265| declare export type ChildrenArray<+T> = $ReadOnlyArray> | T; +======= + /react.js:263:38 + 263| declare export type ChildrenArray<+T> = $ReadOnlyArray> | T; +>>>>>>> Add React.Suspense component and tests ^ [3] @@ -90,8 +95,13 @@ References: api.js:16:25 16| Children.forEach(a, (x: string) => {}); // Error ^^^^^^ [2] +<<<<<<< HEAD /react.js:265:38 265| declare export type ChildrenArray<+T> = $ReadOnlyArray> | T; +======= + /react.js:263:38 + 263| declare export type ChildrenArray<+T> = $ReadOnlyArray> | T; +>>>>>>> Add React.Suspense component and tests ^ [3] api.js:5:25 5| const a: ChildrenArray = [ @@ -107,8 +117,13 @@ Cannot call `s` with `Children.count(...)` bound to `x` because number [1] is in ^^^^^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:277:42 277| count(children: ChildrenArray): number; +======= + /react.js:275:42 + 275| count(children: ChildrenArray): number; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [1] api.js:29:15 29| function s(x: string) {} diff --git a/tests/react_imports/react_imports.exp b/tests/react_imports/react_imports.exp index 6f46b337630..15c335b82c5 100644 --- a/tests/react_imports/react_imports.exp +++ b/tests/react_imports/react_imports.exp @@ -47,8 +47,13 @@ Cannot get `React.Missing` because property `Missing` is missing in module `reac ^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:371:27 371| declare module.exports: $Exports<'react'>; +======= + /react.js:370:27 + 370| declare module.exports: $Exports<'react'>; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^ [1] @@ -155,8 +160,13 @@ Cannot get `React.Missing` because property `Missing` is missing in module `reac ^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:371:27 371| declare module.exports: $Exports<'react'>; +======= + /react.js:370:27 + 370| declare module.exports: $Exports<'react'>; +>>>>>>> Add React.Suspense component and tests ^^^^^^^^^^^^^^^^^ [1] @@ -186,6 +196,7 @@ Cannot get `React.Node` because property `Node` is missing in object type [1]. ^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:336:26 v- 336| declare export default {| @@ -218,6 +229,41 @@ References: 363| +useMemo: typeof useMemo, 364| +useImperativeMethods: typeof useImperativeMethods, 365| |}; +======= + /react.js:334:26 + v- + 334| declare export default {| + 335| +DOM: typeof DOM, + 336| +PropTypes: typeof PropTypes, + 337| +version: typeof version, + 338| +checkPropTypes: typeof checkPropTypes, + 339| +memo: typeof memo, + 340| +lazy: typeof lazy, + 341| +createClass: typeof createClass, + 342| +createContext: typeof createContext, + 343| +createElement: typeof createElement, + 344| +cloneElement: typeof cloneElement, + 345| +createFactory: typeof createFactory, + 346| +createRef: typeof createRef, + 347| +isValidElement: typeof isValidElement, + 348| +Component: typeof Component, + : + 350| +Fragment: typeof Fragment, + 351| +Children: typeof Children, + 352| +ConcurrentMode: typeof ConcurrentMode, + 353| +StrictMode: typeof StrictMode, + 354| +Suspense: typeof Suspense, + 355| +useContext: typeof useContext, + 356| +useState: typeof useState, + 357| +useReducer: typeof useReducer, + 358| +useRef: typeof useRef, + 359| +useEffect: typeof useEffect, + 360| +useLayoutEffect: typeof useLayoutEffect, + 361| +useCallback: typeof useCallback, + 362| +useMemo: typeof useMemo, + 363| +useImperativeMethods: typeof useImperativeMethods, + 364| |}; +>>>>>>> Add React.Suspense component and tests -^ [1] @@ -230,6 +276,7 @@ Cannot get `React.Node` because property `Node` is missing in object type [1]. ^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:336:26 v- 336| declare export default {| @@ -262,6 +309,41 @@ References: 363| +useMemo: typeof useMemo, 364| +useImperativeMethods: typeof useImperativeMethods, 365| |}; +======= + /react.js:334:26 + v- + 334| declare export default {| + 335| +DOM: typeof DOM, + 336| +PropTypes: typeof PropTypes, + 337| +version: typeof version, + 338| +checkPropTypes: typeof checkPropTypes, + 339| +memo: typeof memo, + 340| +lazy: typeof lazy, + 341| +createClass: typeof createClass, + 342| +createContext: typeof createContext, + 343| +createElement: typeof createElement, + 344| +cloneElement: typeof cloneElement, + 345| +createFactory: typeof createFactory, + 346| +createRef: typeof createRef, + 347| +isValidElement: typeof isValidElement, + 348| +Component: typeof Component, + : + 350| +Fragment: typeof Fragment, + 351| +Children: typeof Children, + 352| +ConcurrentMode: typeof ConcurrentMode, + 353| +StrictMode: typeof StrictMode, + 354| +Suspense: typeof Suspense, + 355| +useContext: typeof useContext, + 356| +useState: typeof useState, + 357| +useReducer: typeof useReducer, + 358| +useRef: typeof useRef, + 359| +useEffect: typeof useEffect, + 360| +useLayoutEffect: typeof useLayoutEffect, + 361| +useCallback: typeof useCallback, + 362| +useMemo: typeof useMemo, + 363| +useImperativeMethods: typeof useImperativeMethods, + 364| |}; +>>>>>>> Add React.Suspense component and tests -^ [1] @@ -274,6 +356,7 @@ Cannot get `React.Missing` because property `Missing` is missing in object type ^^^^^^^^^^^^^ References: +<<<<<<< HEAD /react.js:336:26 v- 336| declare export default {| @@ -306,6 +389,41 @@ References: 363| +useMemo: typeof useMemo, 364| +useImperativeMethods: typeof useImperativeMethods, 365| |}; +======= + /react.js:334:26 + v- + 334| declare export default {| + 335| +DOM: typeof DOM, + 336| +PropTypes: typeof PropTypes, + 337| +version: typeof version, + 338| +checkPropTypes: typeof checkPropTypes, + 339| +memo: typeof memo, + 340| +lazy: typeof lazy, + 341| +createClass: typeof createClass, + 342| +createContext: typeof createContext, + 343| +createElement: typeof createElement, + 344| +cloneElement: typeof cloneElement, + 345| +createFactory: typeof createFactory, + 346| +createRef: typeof createRef, + 347| +isValidElement: typeof isValidElement, + 348| +Component: typeof Component, + : + 350| +Fragment: typeof Fragment, + 351| +Children: typeof Children, + 352| +ConcurrentMode: typeof ConcurrentMode, + 353| +StrictMode: typeof StrictMode, + 354| +Suspense: typeof Suspense, + 355| +useContext: typeof useContext, + 356| +useState: typeof useState, + 357| +useReducer: typeof useReducer, + 358| +useRef: typeof useRef, + 359| +useEffect: typeof useEffect, + 360| +useLayoutEffect: typeof useLayoutEffect, + 361| +useCallback: typeof useCallback, + 362| +useMemo: typeof useMemo, + 363| +useImperativeMethods: typeof useImperativeMethods, + 364| |}; +>>>>>>> Add React.Suspense component and tests -^ [1] diff --git a/tests/react_jsx/react_jsx.exp b/tests/react_jsx/react_jsx.exp index 440ec52b76b..72c8b388398 100644 --- a/tests/react_jsx/react_jsx.exp +++ b/tests/react_jsx/react_jsx.exp @@ -93,8 +93,13 @@ References: test.js:105:12 105| string1={null} ^^^^ [1] +<<<<<<< HEAD /react.js:406:36 406| string: React$PropType$Primitive; +======= + /react.js:405:36 + 405| string: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] test.js:106:12 106| string2={null} @@ -102,8 +107,13 @@ References: test.js:107:13 107| boolean1={null} ^^^^ [4] +<<<<<<< HEAD /react.js:402:34 402| bool: React$PropType$Primitive; +======= + /react.js:401:34 + 401| bool: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^^ [5] test.js:108:13 108| boolean2={null} @@ -111,8 +121,13 @@ References: test.js:109:11 109| number={null} ^^^^ [7] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [8] @@ -161,8 +176,13 @@ References: test.js:135:54 135| {...{string1: 'foo', string2: 'bar', number: (any: ?number)}} ^^^^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -1654,8 +1674,13 @@ References: /core.js:13:24 13| declare var undefined: void; ^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -1675,8 +1700,13 @@ References: test.js:788:7 788| foo="nope" ^^^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] @@ -1696,8 +1726,13 @@ References: test.js:793:7 793| bar="nope" ^^^^^^ [1] +<<<<<<< HEAD /react.js:404:36 404| number: React$PropType$Primitive; +======= + /react.js:403:36 + 403| number: React$PropType$Primitive; +>>>>>>> Add React.Suspense component and tests ^^^^^^ [2] diff --git a/tests/type-at-pos_react/type-at-pos_react.exp b/tests/type-at-pos_react/type-at-pos_react.exp index d3c675c9b45..ab16ac552a6 100644 --- a/tests/type-at-pos_react/type-at-pos_react.exp +++ b/tests/type-at-pos_react/type-at-pos_react.exp @@ -1,5 +1,5 @@ react_component.js:3:9 = { - "type":"{|+Children: {+count: (children: ChildrenArray) => number, +forEach: (children: ChildrenArray, fn: (child: T, index: number) => mixed, thisArg?: mixed) => void, +map: (children: ChildrenArray, fn: (child: $NonMaybeType, index: number) => U, thisArg?: mixed) => Array<$NonMaybeType>, +only: (children: ChildrenArray) => $NonMaybeType, +toArray: (children: ChildrenArray) => Array<$NonMaybeType>}, +ChildrenArray: type ChildrenArray<+T> = $ReadOnlyArray> | T, +Component: class React$Component, +ComponentType: type ComponentType

= React$ComponentType

, +ConcurrentMode: ({children: ?React$Node}) => React$Node, +Context: type Context = React$Context, +DOM: any, +Element: type Element<+C> = React$Element, +ElementConfig: type ElementConfig = React$ElementConfig, +ElementProps: type ElementProps = React$ElementProps, +ElementRef: type ElementRef = React$ElementRef, +ElementType: type ElementType = React$ElementType, +Fragment: ({children: ?React$Node}) => React$Node, +Key: type Key = React$Key, +Node: type Node = React$Node, +Portal: type Portal = React$Portal, +PropTypes: ReactPropTypes, +PureComponent: class React$PureComponent, +Ref: type Ref = React$Ref, +StatelessFunctionalComponent: type StatelessFunctionalComponent

= React$StatelessFunctionalComponent

, +StrictMode: ({children: ?React$Node}) => React$Node, +checkPropTypes: (propTypes: $Subtype<{[_: $Keys]: ReactPropsCheckType}>, values: V, location: string, componentName: string, getStack: ?(() => ?string)) => void, +cloneElement: React$CloneElement, +createClass: React$CreateClass, +createContext: (defaultValue: T, calculateChangedBits: ?((a: T, b: T) => number)) => React$Context, +createElement: React$CreateElement, +createFactory: (type: ElementType) => React$ElementFactory, +createRef: () => {current: (null | T)}, +default: {|+Children: {+count: (children: ChildrenArray) => number, +forEach: (children: ChildrenArray, fn: (child: T, index: number) => mixed, thisArg?: mixed) => void, +map: (children: ChildrenArray, fn: (child: $NonMaybeType, index: number) => U, thisArg?: mixed) => Array<$NonMaybeType>, +only: (children: ChildrenArray) => $NonMaybeType, +toArray: (children: ChildrenArray) => Array<$NonMaybeType>}, +Component: class React$Component, +ConcurrentMode: ({children: ?React$Node}) => React$Node, +DOM: any, +Fragment: ({children: ?React$Node}) => React$Node, +PropTypes: ReactPropTypes, +PureComponent: class React$PureComponent, +StrictMode: ({children: ?React$Node}) => React$Node, +checkPropTypes: (propTypes: $Subtype<{[_: $Keys]: ReactPropsCheckType}>, values: V, location: string, componentName: string, getStack: ?(() => ?string)) => void, +cloneElement: React$CloneElement, +createClass: React$CreateClass, +createContext: (defaultValue: T, calculateChangedBits: ?((a: T, b: T) => number)) => React$Context, +createElement: React$CreateElement, +createFactory: (type: ElementType) => React$ElementFactory, +createRef: () => {current: (null | T)}, +isValidElement: (element: any) => boolean, +lazy:

(component: () => React$ComponentType

) => React$ComponentType

, +memo:

(component: React$StatelessFunctionalComponent

, equal?: (P, P) => boolean) => React$StatelessFunctionalComponent

, +useCallback: (callback: () => (T | void), inputs: ?$ReadOnlyArray) => T, +useContext: (context: React$Context, observedBits: (void | number | boolean)) => T, +useEffect: (create: () => MaybeCleanUpFn, inputs: ?$ReadOnlyArray) => void, +useImperativeMethods: (ref: ?({current: (T | null)} | ((inst: (T | null)) => mixed)), create: () => T, inputs: ?$ReadOnlyArray) => void, +useLayoutEffect: (create: () => MaybeCleanUpFn, inputs: ?$ReadOnlyArray) => void, +useMemo: (create: () => T, inputs: ?$ReadOnlyArray) => T, +useReducer: (reducer: (S, A) => S, initialState: S, initialAction: ?A) => [S, (A) => void], +useRef: (initialValue: ?T) => {current: (T | null)}, +useState: (initialState: ((() => S) | S)) => [S, ((((S) => S) | S)) => void], +version: string|}, +isValidElement: (element: any) => boolean, +lazy:

(component: () => React$ComponentType

) => React$ComponentType

, +memo:

(component: React$StatelessFunctionalComponent

, equal?: (P, P) => boolean) => React$StatelessFunctionalComponent

, +useCallback: (callback: () => (T | void), inputs: ?$ReadOnlyArray) => T, +useContext: (context: React$Context, observedBits: (void | number | boolean)) => T, +useEffect: (create: () => MaybeCleanUpFn, inputs: ?$ReadOnlyArray) => void, +useImperativeMethods: (ref: ?({current: (T | null)} | ((inst: (T | null)) => mixed)), create: () => T, inputs: ?$ReadOnlyArray) => void, +useLayoutEffect: (create: () => MaybeCleanUpFn, inputs: ?$ReadOnlyArray) => void, +useMemo: (create: () => T, inputs: ?$ReadOnlyArray) => T, +useReducer: (reducer: (S, A) => S, initialState: S, initialAction: ?A) => [S, (A) => void], +useRef: (initialValue: ?T) => {current: (T | null)}, +useState: (initialState: ((() => S) | S)) => [S, ((((S) => S) | S)) => void], +version: string|}", + "type":"{|+Children: {+count: (children: ChildrenArray) => number, +forEach: (children: ChildrenArray, fn: (child: T, index: number) => mixed, thisArg?: mixed) => void, +map: (children: ChildrenArray, fn: (child: $NonMaybeType, index: number) => U, thisArg?: mixed) => Array<$NonMaybeType>, +only: (children: ChildrenArray) => $NonMaybeType, +toArray: (children: ChildrenArray) => Array<$NonMaybeType>}, +ChildrenArray: type ChildrenArray<+T> = $ReadOnlyArray> | T, +Component: class React$Component, +ComponentType: type ComponentType

= React$ComponentType

, +ConcurrentMode: ({children: ?React$Node}) => React$Node, +Context: type Context = React$Context, +DOM: any, +Element: type Element<+C> = React$Element, +ElementConfig: type ElementConfig = React$ElementConfig, +ElementProps: type ElementProps = React$ElementProps, +ElementRef: type ElementRef = React$ElementRef, +ElementType: type ElementType = React$ElementType, +Fragment: ({children: ?React$Node}) => React$Node, +Key: type Key = React$Key, +Node: type Node = React$Node, +Portal: type Portal = React$Portal, +PropTypes: ReactPropTypes, +PureComponent: class React$PureComponent, +Ref: type Ref = React$Ref, +StatelessFunctionalComponent: type StatelessFunctionalComponent

= React$StatelessFunctionalComponent

, +StrictMode: ({children: ?React$Node}) => React$Node, +Suspense: React$ComponentType<{children?: ?React$Node, fallback: React$Node, maxDuration?: number}>, +checkPropTypes: (propTypes: $Subtype<{[_: $Keys]: ReactPropsCheckType}>, values: V, location: string, componentName: string, getStack: ?(() => ?string)) => void, +cloneElement: React$CloneElement, +createClass: React$CreateClass, +createContext: (defaultValue: T, calculateChangedBits: ?((a: T, b: T) => number)) => React$Context, +createElement: React$CreateElement, +createFactory: (type: ElementType) => React$ElementFactory, +createRef: () => {current: (null | T)}, +default: {|+Children: {+count: (children: ChildrenArray) => number, +forEach: (children: ChildrenArray, fn: (child: T, index: number) => mixed, thisArg?: mixed) => void, +map: (children: ChildrenArray, fn: (child: $NonMaybeType, index: number) => U, thisArg?: mixed) => Array<$NonMaybeType>, +only: (children: ChildrenArray) => $NonMaybeType, +toArray: (children: ChildrenArray) => Array<$NonMaybeType>}, +Component: class React$Component, +ConcurrentMode: ({children: ?React$Node}) => React$Node, +DOM: any, +Fragment: ({children: ?React$Node}) => React$Node, +PropTypes: ReactPropTypes, +PureComponent: class React$PureComponent, +StrictMode: ({children: ?React$Node}) => React$Node, +Suspense: React$ComponentType<{children?: ?React$Node, fallback: React$Node, maxDuration?: number}>, +checkPropTypes: (propTypes: $Subtype<{[_: $Keys]: ReactPropsCheckType}>, values: V, location: string, componentName: string, getStack: ?(() => ?string)) => void, +cloneElement: React$CloneElement, +createClass: React$CreateClass, +createContext: (defaultValue: T, calculateChangedBits: ?((a: T, b: T) => number)) => React$Context, +createElement: React$CreateElement, +createFactory: (type: ElementType) => React$ElementFactory, +createRef: () => {current: (null | T)}, +isValidElement: (element: any) => boolean, +lazy:

(component: () => React$ComponentType

) => React$ComponentType

, +memo:

(component: React$StatelessFunctionalComponent

, equal?: (P, P) => boolean) => React$StatelessFunctionalComponent

, +useCallback: (callback: () => (T | void), inputs: ?$ReadOnlyArray) => T, +useContext: (context: React$Context, observedBits: (void | number | boolean)) => T, +useEffect: (create: () => MaybeCleanUpFn, inputs: ?$ReadOnlyArray) => void, +useImperativeMethods: (ref: ?({current: (T | null)} | ((inst: (T | null)) => mixed)), create: () => T, inputs: ?$ReadOnlyArray) => void, +useLayoutEffect: (create: () => MaybeCleanUpFn, inputs: ?$ReadOnlyArray) => void, +useMemo: (create: () => T, inputs: ?$ReadOnlyArray) => T, +useReducer: (reducer: (S, A) => S, initialState: S, initialAction: ?A) => [S, (A) => void], +useRef: (initialValue: ?T) => {current: (T | null)}, +useState: (initialState: ((() => S) | S)) => [S, ((((S) => S) | S)) => void], +version: string|}, +isValidElement: (element: any) => boolean, +lazy:

(component: () => React$ComponentType

) => React$ComponentType

, +memo:

(component: React$StatelessFunctionalComponent

, equal?: (P, P) => boolean) => React$StatelessFunctionalComponent

, +useCallback: (callback: () => (T | void), inputs: ?$ReadOnlyArray) => T, +useContext: (context: React$Context, observedBits: (void | number | boolean)) => T, +useEffect: (create: () => MaybeCleanUpFn, inputs: ?$ReadOnlyArray) => void, +useImperativeMethods: (ref: ?({current: (T | null)} | ((inst: (T | null)) => mixed)), create: () => T, inputs: ?$ReadOnlyArray) => void, +useLayoutEffect: (create: () => MaybeCleanUpFn, inputs: ?$ReadOnlyArray) => void, +useMemo: (create: () => T, inputs: ?$ReadOnlyArray) => T, +useReducer: (reducer: (S, A) => S, initialState: S, initialAction: ?A) => [S, (A) => void], +useRef: (initialValue: ?T) => {current: (T | null)}, +useState: (initialState: ((() => S) | S)) => [S, ((((S) => S) | S)) => void], +version: string|}", "reasons":[], "loc":{ "source":"react_component.js",