diff --git a/lib/react.js b/lib/react.js index 03cf654c219..5b7dccaa3e7 100644 --- a/lib/react.js +++ b/lib/react.js @@ -250,6 +250,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; @@ -345,6 +351,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 13f2c5668c6..9f7b71ee3d6 100644 --- a/tests/getters_and_setters/getters_and_setters.exp +++ b/tests/getters_and_setters/getters_and_setters.exp @@ -465,8 +465,8 @@ References: react.js:17:13 17| (); // error: number ~> string ^^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -482,8 +482,8 @@ References: react.js:18:20 18| (); // error: number ~> string ^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] diff --git a/tests/new_react/new_react.exp b/tests/new_react/new_react.exp index 3604168f628..5a8401c2aed 100644 --- a/tests/new_react/new_react.exp +++ b/tests/new_react/new_react.exp @@ -189,8 +189,8 @@ Cannot assign `this.props.x` to `_` because number [1] is incompatible with stri ^^^^^^^^^^^^ References: - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [1] classes.js:57:12 57| var _: string = this.props.x; @@ -388,8 +388,8 @@ Cannot assign `this.props.z` to `qux` because: ^^^^^^^^^^^^ References: - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [1] new_react.js:19:18 19| var qux: string = this.props.z; @@ -405,8 +405,8 @@ Cannot assign `this.props.x` to `w` because string [1] is incompatible with numb ^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] new_react.js:20:15 20| var w:number = this.props.x; @@ -439,8 +439,8 @@ References: new_react.js:29:23 29| var element = ; ^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] @@ -545,8 +545,8 @@ Cannot assign `this.props.x` to `a` because: ^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] props.js:14:16 14| var a: number = this.props.x; // error @@ -582,8 +582,8 @@ Cannot assign `this.props.z` to `c` because: ^^^^^^^^^^^^ References: - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [1] props.js:16:16 16| var c: string = this.props.z; // error @@ -604,14 +604,14 @@ References: props.js:20:29 20| var element = ; // 3 errors ^^^^^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] props.js:20:49 20| var element = ; // 3 errors ^^^^^ [3] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [4] @@ -668,8 +668,8 @@ References: props2.js:9:41 9| getInitialState: function(): { bar: number } { ^^^^^^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] props2.js:15:42 15| return ; @@ -700,12 +700,12 @@ Cannot get `React.PropTypes.string.inRequired` because property `inRequired` is ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:372:39 + /react.js:379:39 v - 372| type ReactPropsChainableTypeChecker = { - 373| isRequired: ReactPropsCheckType; - 374| (props: any, propName: string, componentName: string, href?: string): ?Error; - 375| }; + 379| type ReactPropsChainableTypeChecker = { + 380| isRequired: ReactPropsCheckType; + 381| (props: any, propName: string, componentName: string, href?: string): ?Error; + 382| }; ^ [1] diff --git a/tests/react/react.exp b/tests/react/react.exp index 637c6b2d5ba..58b2e3bc630 100644 --- a/tests/react/react.exp +++ b/tests/react/react.exp @@ -80,8 +80,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:7:22 7| (this.props.foo: empty); // error: string ~> empty @@ -97,8 +97,8 @@ Cannot cast `this.props.bar` to empty because number [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [1] create_class.js:8:22 8| (this.props.bar: empty); // error: number ~> empty @@ -251,8 +251,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:117:22 117| (this.props.foo: empty); // string ~> empty @@ -268,8 +268,8 @@ Cannot cast `this.state.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:118:22 118| (this.state.foo: empty); // string ~> empty @@ -285,8 +285,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:133:22 133| (this.props.foo: empty); // string ~> empty @@ -302,8 +302,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:137:22 137| (this.props.foo: empty); // string ~> empty @@ -319,8 +319,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:141:22 141| (this.props.foo: empty); // string ~> empty @@ -336,8 +336,8 @@ Cannot cast `nextProps.foo` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:142:21 142| (nextProps.foo: empty); // string ~> empty @@ -353,8 +353,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:146:22 146| (this.props.foo: empty); // string ~> empty @@ -387,8 +387,8 @@ Cannot cast `nextProps.foo` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:148:21 148| (nextProps.foo: empty); // string ~> empty @@ -435,8 +435,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:153:22 153| (this.props.foo: empty); // string ~> empty @@ -469,8 +469,8 @@ Cannot cast `nextProps.foo` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:155:21 155| (nextProps.foo: empty); // string ~> empty @@ -503,8 +503,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:160:22 160| (this.props.foo: empty); // string ~> empty @@ -537,8 +537,8 @@ Cannot cast `nextProps.foo` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:162:21 162| (nextProps.foo: empty); // string ~> empty @@ -571,8 +571,8 @@ Cannot cast `this.props.foo` to empty because string [1] is incompatible with em ^^^^^^^^^^^^^^ References: - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [1] create_class.js:167:22 167| (this.props.foo: empty); // string ~> empty @@ -1904,8 +1904,8 @@ References: jsx_spread.js:10:19 10| var props = {bar: 42}; ^^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] @@ -2018,8 +2018,8 @@ References: proptype_arrayOf.js:15:45 15| var fail_mistyped_elems = ^^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -2035,8 +2035,8 @@ References: proptype_arrayOf.js:20:36 20| var todo_required = ^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -2053,8 +2053,8 @@ References: proptype_arrayOf.js:30:25 30| (); // error: string ~> number ^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -2092,8 +2092,8 @@ Cannot cast `propName` to empty because string [1] is incompatible with empty [2 ^^^^^^^^ References: - /react.js:368:13 - 368| propName: string, + /react.js:375:13 + 375| propName: string, ^^^^^^ [1] proptype_custom_validator.js:8:18 8| (propName: empty); // error: propName is a string @@ -2109,8 +2109,8 @@ Cannot cast `componentName` to empty because string [1] is incompatible with emp ^^^^^^^^^^^^^ References: - /react.js:369:18 - 369| componentName: string, + /react.js:376:18 + 376| componentName: string, ^^^^^^ [1] proptype_custom_validator.js:9:23 9| (componentName: empty); // error: componentName is a string @@ -2128,8 +2128,8 @@ Cannot cast `href` to empty because: ^^^^ References: - /react.js:370:10 - 370| href?: string) => ?Error; + /react.js:377:10 + 377| href?: string) => ?Error; ^^^^^^ [1] proptype_custom_validator.js:10:14 10| (href: empty); // error: href is an optional string @@ -2148,8 +2148,8 @@ References: proptype_custom_validator.js:11:18 11| return (0: mixed); // error: should return ?Error ^^^^^ [1] - /react.js:370:22 - 370| href?: string) => ?Error; + /react.js:377:22 + 377| href?: string) => ?Error; ^^^^^ [2] @@ -2242,8 +2242,8 @@ References: proptype_objectOf.js:15:47 15| var fail_mistyped_props = ^^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -2259,8 +2259,8 @@ References: proptype_objectOf.js:20:38 20| var todo_required = ^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -2276,8 +2276,8 @@ References: proptype_objectOf.js:30:27 30| (); // error: string ~> number ^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -2452,11 +2452,11 @@ References: proptype_oneOfType.js:24:32 24| var fail_bool = ; ^^^^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [3] @@ -2474,11 +2474,11 @@ References: proptype_oneOfType.js:29:36 29| var todo_required = ; ^^^^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [3] @@ -2494,8 +2494,8 @@ References: proptype_oneOfType.js:41:22 41| (); // error: number ~> string ^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] @@ -2577,14 +2577,14 @@ Cannot cast `React.PropTypes.arrayOf` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:378:17 - 378| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; + /react.js:385:17 + 385| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; ^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] - /react.js:378:41 - 378| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; + /react.js:385:41 + 385| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2601,8 +2601,8 @@ empty [2] in the return value. ^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:380:27 - 380| (expectedClass: any) => ReactPropsChainableTypeChecker; + /react.js:387:27 + 387| (expectedClass: any) => ReactPropsChainableTypeChecker; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2620,14 +2620,14 @@ Cannot cast `React.PropTypes.objectOf` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:382:17 - 382| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; + /react.js:389:17 + 389| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; ^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] - /react.js:382:41 - 382| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; + /react.js:389:41 + 389| (typeChecker: ReactPropsCheckType) => ReactPropsChainableTypeChecker; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2645,14 +2645,14 @@ Cannot cast `React.PropTypes.oneOf` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:384:20 - 384| (expectedValues: Array) => ReactPropsChainableTypeChecker; + /react.js:391:20 + 391| (expectedValues: Array) => ReactPropsChainableTypeChecker; ^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] - /react.js:384:35 - 384| (expectedValues: Array) => ReactPropsChainableTypeChecker; + /react.js:391:35 + 391| (expectedValues: Array) => ReactPropsChainableTypeChecker; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2670,14 +2670,14 @@ Cannot cast `React.PropTypes.oneOfType` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:386:25 - 386| (arrayOfTypeCheckers: Array) => + /react.js:393:25 + 393| (arrayOfTypeCheckers: Array) => ^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] - /react.js:387:5 - 387| ReactPropsChainableTypeChecker; + /react.js:394:5 + 394| ReactPropsChainableTypeChecker; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -2695,14 +2695,14 @@ Cannot cast `React.PropTypes.shape` to `NoFun` because: ^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:389:16 - 389| (shapeTypes: { [key: string]: ReactPropsCheckType }) => + /react.js:396:16 + 396| (shapeTypes: { [key: string]: ReactPropsCheckType }) => ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] proptypes_builtins.js:3:14 3| type NoFun = mixed => empty; ^^^^^ [2] - /react.js:390:5 - 390| ReactPropsChainableTypeChecker; + /react.js:397:5 + 397| ReactPropsChainableTypeChecker; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] proptypes_builtins.js:3:23 3| type NoFun = mixed => empty; @@ -3180,12 +3180,12 @@ Cannot call `React.useCallback` because function [1] requires another argument. ^^^^^^^^^^^^^^^^^^^ References: - /react.js:312:38 + /react.js:318:38 v--- - 312| declare export function useCallback( - 313| callback: () => T | void, - 314| inputs: ?$ReadOnlyArray, - 315| ): T; + 318| declare export function useCallback( + 319| callback: () => T | void, + 320| inputs: ?$ReadOnlyArray, + 321| ): T; ---^ [1] @@ -3216,8 +3216,8 @@ read-only array type [2]. ^^ [1] References: - /react.js:314:14 - 314| inputs: ?$ReadOnlyArray, + /react.js:320:14 + 320| inputs: ?$ReadOnlyArray, ^^^^^^^^^^^^^^^^^^^^^ [2] @@ -3230,12 +3230,12 @@ Cannot call `React.useContext` because function [1] requires another argument. ^^^^^^^^^^^^^^^^^^ References: - /react.js:285:37 + /react.js:291:37 v--- - 285| declare export function useContext( - 286| context: React$Context, - 287| observedBits: void | number | boolean, - 288| ): T; + 291| declare export function useContext( + 292| context: React$Context, + 293| observedBits: void | number | boolean, + 294| ): T; ---^ [1] @@ -3320,12 +3320,12 @@ Cannot call `React.useEffect` because function [1] requires another argument. ^^^^^^^^^^^^^^^^^ References: - /react.js:302:36 + /react.js:308:36 v - 302| declare export function useEffect( - 303| create: () => MaybeCleanUpFn, - 304| inputs: ?$ReadOnlyArray, - 305| ): void; + 308| declare export function useEffect( + 309| create: () => MaybeCleanUpFn, + 310| inputs: ?$ReadOnlyArray, + 311| ): void; ------^ [1] @@ -3338,8 +3338,8 @@ Cannot call `React.useEffect` with `1` bound to `create` because number [1] is i ^ [1] References: - /react.js:303:13 - 303| create: () => MaybeCleanUpFn, + /react.js:309:13 + 309| create: () => MaybeCleanUpFn, ^^^^^^^^^^^^^^^^^^^^ [2] @@ -3353,8 +3353,8 @@ type [2]. ^ [1] References: - /react.js:304:14 - 304| inputs: ?$ReadOnlyArray, + /react.js:310:14 + 310| inputs: ?$ReadOnlyArray, ^^^^^^^^^^^^^^^^^^^^^ [2] @@ -3367,13 +3367,13 @@ Cannot call `React.useImperativeMethods` because function [1] requires another a ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:322:47 + /react.js:328:47 v--- - 322| declare export function useImperativeMethods( - 323| ref: {current: T | null} | ((inst: T | null) => mixed) | null | void, - 324| create: () => T, - 325| inputs: ?$ReadOnlyArray, - 326| ): void; + 328| declare export function useImperativeMethods( + 329| ref: {current: T | null} | ((inst: T | null) => mixed) | null | void, + 330| create: () => T, + 331| inputs: ?$ReadOnlyArray, + 332| ): void; ------^ [1] @@ -3422,12 +3422,12 @@ Cannot call `React.useLayoutEffect` because function [1] requires another argume ^^^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:307:42 + /react.js:313:42 v - 307| declare export function useLayoutEffect( - 308| create: () => MaybeCleanUpFn, - 309| inputs: ?$ReadOnlyArray, - 310| ): void; + 313| declare export function useLayoutEffect( + 314| create: () => MaybeCleanUpFn, + 315| inputs: ?$ReadOnlyArray, + 316| ): void; ------^ [1] @@ -3441,8 +3441,8 @@ type [2]. ^ [1] References: - /react.js:308:13 - 308| create: () => MaybeCleanUpFn, + /react.js:314:13 + 314| create: () => MaybeCleanUpFn, ^^^^^^^^^^^^^^^^^^^^ [2] @@ -3456,8 +3456,8 @@ type [2]. ^ [1] References: - /react.js:309:14 - 309| inputs: ?$ReadOnlyArray, + /react.js:315:14 + 315| inputs: ?$ReadOnlyArray, ^^^^^^^^^^^^^^^^^^^^^ [2] @@ -3470,12 +3470,12 @@ Cannot call `React.useMemo` because function [1] requires another argument. ^^^^^^^^^^^^^^^ References: - /react.js:317:34 + /react.js:323:34 v--- - 317| declare export function useMemo( - 318| create: () => T, - 319| inputs: ?$ReadOnlyArray, - 320| ): T; + 323| declare export function useMemo( + 324| create: () => T, + 325| inputs: ?$ReadOnlyArray, + 326| ): T; ---^ [1] @@ -3505,13 +3505,13 @@ Cannot call `React.useReducer` because function [1] requires another argument. ^^^^^^^^^^^^^^^^^^ References: - /react.js:294:37 + /react.js:300:37 v------ - 294| declare export function useReducer( - 295| reducer: (S, A) => S, - 296| initialState: S, - 297| initialAction: ?A, - 298| ): [S, A => void]; + 300| declare export function useReducer( + 301| reducer: (S, A) => S, + 302| initialState: S, + 303| initialAction: ?A, + 304| ): [S, A => void]; ----------------^ [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 3ac2539febf..5de46d0bcef 100644 --- a/tests/react_children/react_children.exp +++ b/tests/react_children/react_children.exp @@ -68,8 +68,8 @@ References: api.js:14:25 14| Children.forEach(a, (x: number) => {}); // Error ^^^^^^ [2] - /react.js:257:38 - 257| declare export type ChildrenArray<+T> = $ReadOnlyArray> | T; + /react.js:263:38 + 263| declare export type ChildrenArray<+T> = $ReadOnlyArray> | T; ^ [3] @@ -90,8 +90,8 @@ References: api.js:16:25 16| Children.forEach(a, (x: string) => {}); // Error ^^^^^^ [2] - /react.js:257:38 - 257| declare export type ChildrenArray<+T> = $ReadOnlyArray> | T; + /react.js:263:38 + 263| declare export type ChildrenArray<+T> = $ReadOnlyArray> | T; ^ [3] api.js:5:25 5| const a: ChildrenArray = [ @@ -107,8 +107,8 @@ Cannot call `s` with `Children.count(...)` bound to `x` because number [1] is in ^^^^^^^^^^^^^^^^^ References: - /react.js:269:42 - 269| count(children: ChildrenArray): number; + /react.js:275:42 + 275| count(children: ChildrenArray): number; ^^^^^^ [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 517c0759c17..9ab0908f44f 100644 --- a/tests/react_imports/react_imports.exp +++ b/tests/react_imports/react_imports.exp @@ -47,8 +47,8 @@ Cannot get `React.Missing` because property `Missing` is missing in module `reac ^^^^^^^^^^^^^ References: - /react.js:363:27 - 363| declare module.exports: $Exports<'react'>; + /react.js:370:27 + 370| declare module.exports: $Exports<'react'>; ^^^^^^^^^^^^^^^^^ [1] @@ -155,8 +155,8 @@ Cannot get `React.Missing` because property `Missing` is missing in module `reac ^^^^^^^^^^^^^ References: - /react.js:363:27 - 363| declare module.exports: $Exports<'react'>; + /react.js:370:27 + 370| declare module.exports: $Exports<'react'>; ^^^^^^^^^^^^^^^^^ [1] @@ -186,38 +186,39 @@ Cannot get `React.Node` because property `Node` is missing in object type [1]. ^^^^^^^^^^ References: - /react.js:328:26 + /react.js:334:26 v- - 328| declare export default {| - 329| +DOM: typeof DOM, - 330| +PropTypes: typeof PropTypes, - 331| +version: typeof version, - 332| +checkPropTypes: typeof checkPropTypes, - 333| +memo: typeof memo, - 334| +lazy: typeof lazy, - 335| +createClass: typeof createClass, - 336| +createContext: typeof createContext, - 337| +createElement: typeof createElement, - 338| +cloneElement: typeof cloneElement, - 339| +createFactory: typeof createFactory, - 340| +createRef: typeof createRef, - 341| +isValidElement: typeof isValidElement, - 342| +Component: typeof Component, - 343| +PureComponent: typeof PureComponent, - 344| +Fragment: typeof Fragment, - 345| +Children: typeof Children, - 346| +ConcurrentMode: typeof ConcurrentMode, - 347| +StrictMode: typeof StrictMode, - 348| +useContext: typeof useContext, - 349| +useState: typeof useState, - 350| +useReducer: typeof useReducer, - 351| +useRef: typeof useRef, - 352| +useEffect: typeof useEffect, - 353| +useLayoutEffect: typeof useLayoutEffect, - 354| +useCallback: typeof useCallback, - 355| +useMemo: typeof useMemo, - 356| +useImperativeMethods: typeof useImperativeMethods, - 357| |}; + 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| |}; -^ [1] @@ -230,38 +231,39 @@ Cannot get `React.Node` because property `Node` is missing in object type [1]. ^^^^^^^^^^ References: - /react.js:328:26 + /react.js:334:26 v- - 328| declare export default {| - 329| +DOM: typeof DOM, - 330| +PropTypes: typeof PropTypes, - 331| +version: typeof version, - 332| +checkPropTypes: typeof checkPropTypes, - 333| +memo: typeof memo, - 334| +lazy: typeof lazy, - 335| +createClass: typeof createClass, - 336| +createContext: typeof createContext, - 337| +createElement: typeof createElement, - 338| +cloneElement: typeof cloneElement, - 339| +createFactory: typeof createFactory, - 340| +createRef: typeof createRef, - 341| +isValidElement: typeof isValidElement, - 342| +Component: typeof Component, - 343| +PureComponent: typeof PureComponent, - 344| +Fragment: typeof Fragment, - 345| +Children: typeof Children, - 346| +ConcurrentMode: typeof ConcurrentMode, - 347| +StrictMode: typeof StrictMode, - 348| +useContext: typeof useContext, - 349| +useState: typeof useState, - 350| +useReducer: typeof useReducer, - 351| +useRef: typeof useRef, - 352| +useEffect: typeof useEffect, - 353| +useLayoutEffect: typeof useLayoutEffect, - 354| +useCallback: typeof useCallback, - 355| +useMemo: typeof useMemo, - 356| +useImperativeMethods: typeof useImperativeMethods, - 357| |}; + 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| |}; -^ [1] @@ -274,38 +276,39 @@ Cannot get `React.Missing` because property `Missing` is missing in object type ^^^^^^^^^^^^^ References: - /react.js:328:26 + /react.js:334:26 v- - 328| declare export default {| - 329| +DOM: typeof DOM, - 330| +PropTypes: typeof PropTypes, - 331| +version: typeof version, - 332| +checkPropTypes: typeof checkPropTypes, - 333| +memo: typeof memo, - 334| +lazy: typeof lazy, - 335| +createClass: typeof createClass, - 336| +createContext: typeof createContext, - 337| +createElement: typeof createElement, - 338| +cloneElement: typeof cloneElement, - 339| +createFactory: typeof createFactory, - 340| +createRef: typeof createRef, - 341| +isValidElement: typeof isValidElement, - 342| +Component: typeof Component, - 343| +PureComponent: typeof PureComponent, - 344| +Fragment: typeof Fragment, - 345| +Children: typeof Children, - 346| +ConcurrentMode: typeof ConcurrentMode, - 347| +StrictMode: typeof StrictMode, - 348| +useContext: typeof useContext, - 349| +useState: typeof useState, - 350| +useReducer: typeof useReducer, - 351| +useRef: typeof useRef, - 352| +useEffect: typeof useEffect, - 353| +useLayoutEffect: typeof useLayoutEffect, - 354| +useCallback: typeof useCallback, - 355| +useMemo: typeof useMemo, - 356| +useImperativeMethods: typeof useImperativeMethods, - 357| |}; + 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| |}; -^ [1] diff --git a/tests/react_jsx/react_jsx.exp b/tests/react_jsx/react_jsx.exp index 64d539d5eb8..4760e367f51 100644 --- a/tests/react_jsx/react_jsx.exp +++ b/tests/react_jsx/react_jsx.exp @@ -93,8 +93,8 @@ References: test.js:105:12 105| string1={null} ^^^^ [1] - /react.js:398:36 - 398| string: React$PropType$Primitive; + /react.js:405:36 + 405| string: React$PropType$Primitive; ^^^^^^ [2] test.js:106:12 106| string2={null} @@ -102,8 +102,8 @@ References: test.js:107:13 107| boolean1={null} ^^^^ [4] - /react.js:394:34 - 394| bool: React$PropType$Primitive; + /react.js:401:34 + 401| bool: React$PropType$Primitive; ^^^^^^^ [5] test.js:108:13 108| boolean2={null} @@ -111,8 +111,8 @@ References: test.js:109:11 109| number={null} ^^^^ [7] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [8] @@ -161,8 +161,8 @@ References: test.js:135:54 135| {...{string1: 'foo', string2: 'bar', number: (any: ?number)}} ^^^^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -1654,8 +1654,8 @@ References: /core.js:13:24 13| declare var undefined: void; ^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -1675,8 +1675,8 @@ References: test.js:788:7 788| foo="nope" ^^^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [2] @@ -1696,8 +1696,8 @@ References: test.js:793:7 793| bar="nope" ^^^^^^ [1] - /react.js:396:36 - 396| number: React$PropType$Primitive; + /react.js:403:36 + 403| number: React$PropType$Primitive; ^^^^^^ [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 769249b9da5..127f4b9a7f5 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",