diff --git a/lib/react.js b/lib/react.js index 8a847d32b8a..0501d6d736d 100644 --- a/lib/react.js +++ b/lib/react.js @@ -114,19 +114,6 @@ declare type React$AbstractComponentStatics = { ... }; -/** - * The type of a stateless functional component. In most cases these components - * are a single function. However, they may have some static properties that we - * can type check. - */ -declare type React$StatelessFunctionalComponent = { - (props: Props, context: any): React$Node, - displayName?: ?string, - propTypes?: any, - contextTypes?: any, - ... -}; - /** * The type of a component in React. A React component may be a: * @@ -306,8 +293,6 @@ declare module react { * @see https://react.dev/reference/react/PureComponent */ declare export var PureComponent: typeof React$PureComponent; - declare export type StatelessFunctionalComponent

= - React$StatelessFunctionalComponent

; declare export type ComponentType<-P> = React$ComponentType

; declare export type AbstractComponent< -Config, diff --git a/src/services/code_action/insert_type_utils.ml b/src/services/code_action/insert_type_utils.ml index d2c8cddb8da..8728fdb974f 100644 --- a/src/services/code_action/insert_type_utils.ml +++ b/src/services/code_action/insert_type_utils.ml @@ -612,8 +612,7 @@ class patch_up_react_mapper ?(imports_react = false) () = Reason.OrdinaryName ( ( "AbstractComponent" | "ChildrenArray" | "ComponentType" | "Config" | "Context" | "Element" | "MixedElement" | "ElementConfig" | "ElementProps" - | "ElementRef" | "ElementType" | "Key" | "Node" | "Portal" | "Ref" - | "StatelessFunctionalComponent" ) as name + | "ElementRef" | "ElementType" | "Key" | "Node" | "Portal" | "Ref" ) as name ); sym_provenance = Ty_symbol.Library { Ty_symbol.imported_as = None }; sym_def_loc; diff --git a/tests/badly_positioned_react/badly_positioned_react.exp b/tests/badly_positioned_react/badly_positioned_react.exp index 8c430dfd311..df16b748dbe 100644 --- a/tests/badly_positioned_react/badly_positioned_react.exp +++ b/tests/badly_positioned_react/badly_positioned_react.exp @@ -14,8 +14,8 @@ References: test.js:21:29 21| const Foo1 = create(create1<{||}>(Foo)); ^^^^ [2] - /react.js:311:38 - 311| declare export type ComponentType<-P> = React$ComponentType

; + /react.js:296:38 + 296| declare export type ComponentType<-P> = React$ComponentType

; ^ [3] diff --git a/tests/component_syntax/component_syntax.exp b/tests/component_syntax/component_syntax.exp index 66a42607ebd..2dfd7df4aaf 100644 --- a/tests/component_syntax/component_syntax.exp +++ b/tests/component_syntax/component_syntax.exp @@ -170,11 +170,11 @@ References: annotation.js:48:39 48| declare var InlineRef: component(ref: number); // error ^^^^^^ [1] - /react.js:186:5 - 186| | { -current: T | null, ... } + /react.js:173:5 + 173| | { -current: T | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] - /react.js:187:6 - 187| | ((T | null) => mixed); + /react.js:174:6 + 174| | ((T | null) => mixed); ^^^^^^^^^^^^^^^^^^^ [3] @@ -632,8 +632,8 @@ References: component_in_type_position.js:10:25 10| const polyElemBad: Poly = ; // ERROR ^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -1048,11 +1048,11 @@ References: declared.js:50:34 50| declare component InlineRef(ref: number); // error ^^^^^^ [1] - /react.js:186:5 - 186| | { -current: T | null, ... } + /react.js:173:5 + 173| | { -current: T | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] - /react.js:187:6 - 187| | ((T | null) => mixed); + /react.js:174:6 + 174| | ((T | null) => mixed); ^^^^^^^^^^^^^^^^^^^ [3] @@ -1782,8 +1782,8 @@ References: import_component_in_type_position.js:12:31 12| const polyElemError: PolyType = ; ^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -1803,8 +1803,8 @@ References: component_in_type_position.js:3:8 3| export component Foo() { return null } ^^^^^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] @@ -1927,11 +1927,11 @@ References: names.js:22:29 22| export component NoRef(ref: string) { return

}; // Error ^^^^^^ [1] - /react.js:186:5 - 186| | { -current: T | null, ... } + /react.js:173:5 + 173| | { -current: T | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] - /react.js:187:6 - 187| | ((T | null) => mixed); + /react.js:174:6 + 174| | ((T | null) => mixed); ^^^^^^^^^^^^^^^^^^^ [3] @@ -1993,8 +1993,8 @@ Cannot cast `Foo` to `React.AbstractComponent` because `React.Element` [1] is in ^^^ References: - /react.js:162:35 - 162| declare type React$MixedElement = React$Element; + /react.js:149:35 + 149| declare type React$MixedElement = React$Element; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] nominal.js:17:43 17| Foo as React.AbstractComponent<{}, mixed, null>; // ERROR, default render is React.Node @@ -2390,8 +2390,8 @@ References: propsof.js:26:18 26| component C(ref: React.RefSetter>) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /react.js:177:5 - 177| | { -current: React$ElementRef | null, ... } + /react.js:164:5 + 164| | { -current: React$ElementRef | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] propsof.js:26:34 26| component C(ref: React.RefSetter>) { @@ -2422,8 +2422,8 @@ References: propsof.js:26:18 26| component C(ref: React.RefSetter>) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] - /react.js:178:6 - 178| | ((React$ElementRef | null) => mixed) + /react.js:165:6 + 165| | ((React$ElementRef | null) => mixed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] @@ -2479,8 +2479,8 @@ The `ref` parameter must be a subtype of `React.RefSetter`. ^^^ References: - /react.js:186:21 - 186| | { -current: T | null, ... } + /react.js:173:21 + 173| | { -current: T | null, ... } ^^^^ [1] refs.js:3:30 3| component Foo(ref: {current: typeof Reffed}) { return null }; @@ -2488,8 +2488,8 @@ References: refs.js:3:20 3| component Foo(ref: {current: typeof Reffed}) { return null }; ^^^^^^^^^^^^^^^^^^^^^^^^ [3] - /react.js:187:6 - 187| | ((T | null) => mixed); + /react.js:174:6 + 174| | ((T | null) => mixed); ^^^^^^^^^^^^^^^^^^^ [4] @@ -2509,14 +2509,14 @@ References: refs.js:5:22 5| component Bar(ref: ((typeof Reffed) => mixed)) { return null }; ^^^^^^^^^^^^^ [1] - /react.js:187:11 - 187| | ((T | null) => mixed); + /react.js:174:11 + 174| | ((T | null) => mixed); ^^^^ [2] refs.js:5:21 5| component Bar(ref: ((typeof Reffed) => mixed)) { return null }; ^^^^^^^^^^^^^^^^^^^^^^^^ [3] - /react.js:186:5 - 186| | { -current: T | null, ... } + /react.js:173:5 + 173| | { -current: T | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] @@ -2586,8 +2586,8 @@ References: refs.js:60:43 60| component MyInput(label: string, ref: React$RefSetter, ...otherProps: { other: string}) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /react.js:177:5 - 177| | { -current: React$ElementRef | null, ... } + /react.js:164:5 + 164| | { -current: React$ElementRef | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] refs.js:56:66 56| component MyNestedInput(other: string, ref: React$RefSetter) { @@ -2625,8 +2625,8 @@ References: refs.js:60:43 60| component MyInput(label: string, ref: React$RefSetter, ...otherProps: { other: string}) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] - /react.js:178:6 - 178| | ((React$ElementRef | null) => mixed) + /react.js:165:6 + 165| | ((React$ElementRef | null) => mixed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [5] diff --git a/tests/constrain_writes/constrain_writes.exp b/tests/constrain_writes/constrain_writes.exp index 34a0d7d2cb4..b377b32cc69 100644 --- a/tests/constrain_writes/constrain_writes.exp +++ b/tests/constrain_writes/constrain_writes.exp @@ -261,8 +261,8 @@ References: wiki_examples.js:18:32 18| declare var OtherComponent: (OtherProps) => React.Node; ^^^^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] wiki_examples.js:14:7 14| let element = @@ -286,8 +286,8 @@ References: wiki_examples.js:12:28 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] wiki_examples.js:14:7 14| let element = @@ -311,8 +311,8 @@ References: wiki_examples.js:18:32 18| declare var OtherComponent: (OtherProps) => React.Node; ^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = @@ -336,8 +336,8 @@ References: wiki_examples.js:12:28 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = @@ -361,8 +361,8 @@ References: wiki_examples.js:12:47 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = @@ -386,8 +386,8 @@ References: wiki_examples.js:12:47 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = @@ -411,8 +411,8 @@ References: wiki_examples.js:12:47 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = @@ -436,8 +436,8 @@ References: wiki_examples.js:12:47 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = @@ -461,8 +461,8 @@ References: wiki_examples.js:12:47 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = @@ -486,8 +486,8 @@ References: wiki_examples.js:12:47 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = @@ -511,8 +511,8 @@ References: wiki_examples.js:12:47 12| let Component = ({prop}: Props) => { return <>{prop} } ^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] wiki_examples.js:14:7 14| let element = diff --git a/tests/jsx_intrinsics.builtin/jsx_intrinsics.builtin.exp b/tests/jsx_intrinsics.builtin/jsx_intrinsics.builtin.exp index 3ebdbd56758..fede46ee798 100644 --- a/tests/jsx_intrinsics.builtin/jsx_intrinsics.builtin.exp +++ b/tests/jsx_intrinsics.builtin/jsx_intrinsics.builtin.exp @@ -14,8 +14,8 @@ References: main.js:5:7 5| class CustomComponentNope extends React.Component<{prop: string}, void> {} ^^^^^^^^^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] @@ -35,8 +35,8 @@ References: main.js:11:38 11| var c: Element>> = ^^^^^^^^^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -59,8 +59,8 @@ References: /react.js:30:31 30| declare class React$Component { ^^^^^ [3] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [4] @@ -83,8 +83,8 @@ References: /react.js:30:31 30| declare class React$Component { ^^^^^ [3] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [4] @@ -101,8 +101,8 @@ References: main.js:19:16 19| var e: Element<'span'> =
; ^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] diff --git a/tests/more_react/more_react.exp b/tests/more_react/more_react.exp index f1f14c5c058..3abb7b8ea7d 100644 --- a/tests/more_react/more_react.exp +++ b/tests/more_react/more_react.exp @@ -140,8 +140,8 @@ References: /react.js:30:15 30| declare class React$Component { ^^^^^^^^^^^^^^^ [2] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [3] @@ -179,8 +179,8 @@ References: /react.js:30:15 30| declare class React$Component { ^^^^^^^^^^^^^^^ [2] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [3] @@ -218,8 +218,8 @@ References: /react.js:30:15 30| declare class React$Component { ^^^^^^^^^^^^^^^ [2] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [3] diff --git a/tests/new_generics/new_generics.exp b/tests/new_generics/new_generics.exp index 38ee0c2e6e8..3996b97e21a 100644 --- a/tests/new_generics/new_generics.exp +++ b/tests/new_generics/new_generics.exp @@ -1065,8 +1065,8 @@ References: react.js:13:28 13| a as React.ComponentType<{a: number}>; // nope, contravariance ^^^^^^^^^^^ [2] - /react.js:311:38 - 311| declare export type ComponentType<-P> = React$ComponentType

; + /react.js:296:38 + 296| declare export type ComponentType<-P> = React$ComponentType

; ^ [3] diff --git a/tests/new_react/new_react.exp b/tests/new_react/new_react.exp index 0ffc9986012..569c0d61c5e 100644 --- a/tests/new_react/new_react.exp +++ b/tests/new_react/new_react.exp @@ -174,11 +174,11 @@ References: classes.js:39:15 39| var foo: $jsx = ; ^^^^^^ [1] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [2] - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] @@ -198,8 +198,8 @@ References: classes.js:39:15 39| var foo: $jsx = ; ^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] diff --git a/tests/react/react.exp b/tests/react/react.exp index b070e0cd1a2..8cdda782ccf 100644 --- a/tests/react/react.exp +++ b/tests/react/react.exp @@ -9,8 +9,8 @@ Cannot cast `x` to `React.RefSetter` because in type argument `T` [1]: [incompat ^ References: - /react.js:337:34 - 337| declare export type RefSetter<-T> = React$RefSetter; + /react.js:322:34 + 322| declare export type RefSetter<-T> = React$RefSetter; ^ [1] contravariant_refsetter.js:11:39 11| (x: React.RefSetter); // ERROR @@ -48,8 +48,8 @@ References: contravariant_refsetter.js:7:18 7| declare const y: React$RefSetter; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] - /react.js:187:6 - 187| | ((T | null) => mixed); + /react.js:174:6 + 174| | ((T | null) => mixed); ^^^^^^^^^^^^^^^^^^^ [5] @@ -68,8 +68,8 @@ References: contravariant_refsetter.js:7:18 7| declare const y: React$RefSetter; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /react.js:186:5 - 186| | { -current: T | null, ... } + /react.js:173:5 + 173| | { -current: T | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] contravariant_refsetter.js:12:39 12| (y: React.RefSetter); // ERROR @@ -428,8 +428,8 @@ References: element_with_component_type.js:3:35 3| class Foo extends React.Component<{a: number}> {} ^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] @@ -449,8 +449,8 @@ References: element_with_component_type.js:6:51 6| (: React.Element>); // Error ^^^^^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -1183,11 +1183,11 @@ Cannot create `Foo` element because in property `key`: [incompatible-type] ^^^^ [1] References: - /react.js:168:26 - 168| declare type React$Key = string | number; + /react.js:155:26 + 155| declare type React$Key = string | number; ^^^^^^ [2] - /react.js:168:35 - 168| declare type React$Key = string | number; + /react.js:155:35 + 155| declare type React$Key = string | number; ^^^^^^ [3] @@ -1202,11 +1202,11 @@ Cannot create `FooExact` element because in property `key`: [incompatible-type] ^^^^ [1] References: - /react.js:168:26 - 168| declare type React$Key = string | number; + /react.js:155:26 + 155| declare type React$Key = string | number; ^^^^^^ [2] - /react.js:168:35 - 168| declare type React$Key = string | number; + /react.js:155:35 + 155| declare type React$Key = string | number; ^^^^^^ [3] @@ -1289,8 +1289,8 @@ References: ref.js:3:7 3| class Foo extends React.Component<{}, void> {} ^^^ [2] - /react.js:177:5 - 177| | { -current: React$ElementRef | null, ... } + /react.js:164:5 + 164| | { -current: React$ElementRef | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] @@ -1303,8 +1303,8 @@ Cannot cast `foo` to `Foo` because null [1] is incompatible with `Foo` [2]. [inc ^^^ References: - /react.js:178:39 - 178| | ((React$ElementRef | null) => mixed) + /react.js:165:39 + 165| | ((React$ElementRef | null) => mixed) ^^^^ [1] ref.js:11:24 11| (foo: Foo)} />; // Error: `Foo` may be null. @@ -1350,8 +1350,8 @@ References: ref.js:15:7 15| class FooExact extends React.Component<{||}, void> {} ^^^^^^^^ [2] - /react.js:177:5 - 177| | { -current: React$ElementRef | null, ... } + /react.js:164:5 + 164| | { -current: React$ElementRef | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] @@ -1369,11 +1369,11 @@ References: ref.js:22:22 22| {}} />; // Error: `FooExact` may be null. ^^^^^^^^ [1] - /react.js:178:39 - 178| | ((React$ElementRef | null) => mixed) + /react.js:165:39 + 165| | ((React$ElementRef | null) => mixed) ^^^^ [2] - /react.js:177:5 - 177| | { -current: React$ElementRef | null, ... } + /react.js:164:5 + 164| | { -current: React$ElementRef | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] @@ -1388,8 +1388,8 @@ Cannot create `FooExact` element because in property `ref`: [incompatible-type] ^^^^^^^^^^^^^^^^^^^^^^^ [1] References: - /react.js:177:5 - 177| | { -current: React$ElementRef | null, ... } + /react.js:164:5 + 164| | { -current: React$ElementRef | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] ref.js:15:7 15| class FooExact extends React.Component<{||}, void> {} @@ -1427,8 +1427,8 @@ References: useCallback_hook.js:4:3 4| React.useCallback(); // Error: function requires another argument. ^^^^^^^^^^^^^^^^^^^ [1] - /react.js:522:42 - 522| declare export function useCallback) => mixed>( + /react.js:507:42 + 507| declare export function useCallback) => mixed>( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -1506,8 +1506,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -1571,8 +1571,8 @@ Cannot call `React.useContext` because no more than 1 argument is expected by fu ^^^^^ References: - /react.js:436:37 - 436| declare export function useContext(context: React$Context): T; + /react.js:421:37 + 421| declare export function useContext(context: React$Context): T; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] @@ -1585,8 +1585,8 @@ Cannot call `React.useContext` because no more than 1 argument is expected by fu ^^^^^ References: - /react.js:436:37 - 436| declare export function useContext(context: React$Context): T; + /react.js:421:37 + 421| declare export function useContext(context: React$Context): T; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] @@ -1616,8 +1616,8 @@ Cannot call `React.useDebugValue` because property `useDebugValue` is missing in ^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -1630,12 +1630,12 @@ Cannot call `React.useEffect` because function [1] requires another argument. [i ^^^^^^^^^ References: - /react.js:498:36 + /react.js:483:36 v - 498| declare export function useEffect( - 499| create: () => MaybeCleanUpFn, - 500| inputs?: ?$ReadOnlyArray, - 501| ): void; + 483| declare export function useEffect( + 484| create: () => MaybeCleanUpFn, + 485| inputs?: ?$ReadOnlyArray, + 486| ): void; ------^ [1] @@ -1649,8 +1649,8 @@ Cannot call `React.useEffect` with `1` bound to `create` because number [1] is i ^ [1] References: - /react.js:499:13 - 499| create: () => MaybeCleanUpFn, + /react.js:484:13 + 484| create: () => MaybeCleanUpFn, ^^^^^^^^^^^^^^^^^^^^ [2] @@ -1664,8 +1664,8 @@ type [2]. [incompatible-call] ^ [1] References: - /react.js:500:15 - 500| inputs?: ?$ReadOnlyArray, + /react.js:485:15 + 485| inputs?: ?$ReadOnlyArray, ^^^^^^^^^^^^^^^^^^^^^ [2] @@ -1681,11 +1681,11 @@ Cannot call `React.useEffect` with async function bound to `create` because in t ^ [1] References: - /react.js:427:41 - 427| declare type MaybeCleanUpFn = void | (() => void); + /react.js:412:41 + 412| declare type MaybeCleanUpFn = void | (() => void); ^^^^^^^^^^ [2] - /react.js:427:33 - 427| declare type MaybeCleanUpFn = void | (() => void); + /react.js:412:33 + 412| declare type MaybeCleanUpFn = void | (() => void); ^^^^ [3] @@ -1703,11 +1703,11 @@ References: useEffect_hook.js:23:31 23| React.useEffect(() => () => 123) // Error: cleanup function should not return a value ^^^ [1] - /react.js:427:47 - 427| declare type MaybeCleanUpFn = void | (() => void); + /react.js:412:47 + 412| declare type MaybeCleanUpFn = void | (() => void); ^^^^ [2] - /react.js:427:33 - 427| declare type MaybeCleanUpFn = void | (() => void); + /react.js:412:33 + 412| declare type MaybeCleanUpFn = void | (() => void); ^^^^ [4] @@ -1720,13 +1720,13 @@ Cannot call `React.useImperativeHandle` because function [1] requires another ar ^^^^^^^^^^^^^^^^^^^ References: - /react.js:544:46 + /react.js:529:46 v--- - 544| declare export function useImperativeHandle( - 545| ref: React$RefSetter | null | void, - 546| create: () => T, - 547| inputs: ?$ReadOnlyArray, - 548| ): void; + 529| declare export function useImperativeHandle( + 530| ref: React$RefSetter | null | void, + 531| create: () => T, + 532| inputs: ?$ReadOnlyArray, + 533| ): void; ------^ [1] @@ -1751,8 +1751,8 @@ References: useImperativeHandle_hook.js:28:14 28| const ref: {current: null | Interface } = React.createRef(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] - /react.js:187:6 - 187| | ((T | null) => mixed); + /react.js:174:6 + 174| | ((T | null) => mixed); ^^^^^^^^^^^^^^^^^^^ [4] @@ -1770,8 +1770,8 @@ References: useImperativeHandle_hook.js:31:21 31| const refSetter = (instance: null | Interface) => {}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /react.js:186:5 - 186| | { -current: T | null, ... } + /react.js:173:5 + 173| | { -current: T | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] useImperativeHandle_hook.js:32:47 32| React.useImperativeHandle(refSetter, () => ({})); // Error: inexact object literal is incompatible with exact Interface @@ -1790,12 +1790,12 @@ Cannot call `React.useLayoutEffect` because function [1] requires another argume ^^^^^^^^^^^^^^^ References: - /react.js:511:42 + /react.js:496:42 v - 511| declare export function useLayoutEffect( - 512| create: () => MaybeCleanUpFn, - 513| inputs?: ?$ReadOnlyArray, - 514| ): void; + 496| declare export function useLayoutEffect( + 497| create: () => MaybeCleanUpFn, + 498| inputs?: ?$ReadOnlyArray, + 499| ): void; ------^ [1] @@ -1809,8 +1809,8 @@ type [2]. [incompatible-call] ^ [1] References: - /react.js:512:13 - 512| create: () => MaybeCleanUpFn, + /react.js:497:13 + 497| create: () => MaybeCleanUpFn, ^^^^^^^^^^^^^^^^^^^^ [2] @@ -1824,8 +1824,8 @@ type [2]. [incompatible-call] ^ [1] References: - /react.js:513:15 - 513| inputs?: ?$ReadOnlyArray, + /react.js:498:15 + 498| inputs?: ?$ReadOnlyArray, ^^^^^^^^^^^^^^^^^^^^^ [2] @@ -1842,11 +1842,11 @@ Cannot call `React.useLayoutEffect` with async function bound to `create` becaus ^ [1] References: - /react.js:427:41 - 427| declare type MaybeCleanUpFn = void | (() => void); + /react.js:412:41 + 412| declare type MaybeCleanUpFn = void | (() => void); ^^^^^^^^^^ [2] - /react.js:427:33 - 427| declare type MaybeCleanUpFn = void | (() => void); + /react.js:412:33 + 412| declare type MaybeCleanUpFn = void | (() => void); ^^^^ [3] @@ -1864,11 +1864,11 @@ References: useLayoutEffect_hook.js:23:37 23| React.useLayoutEffect(() => () => 123) // Error: cleanup function should not return a value ^^^ [1] - /react.js:427:47 - 427| declare type MaybeCleanUpFn = void | (() => void); + /react.js:412:47 + 412| declare type MaybeCleanUpFn = void | (() => void); ^^^^ [2] - /react.js:427:33 - 427| declare type MaybeCleanUpFn = void | (() => void); + /react.js:412:33 + 412| declare type MaybeCleanUpFn = void | (() => void); ^^^^ [4] @@ -1881,12 +1881,12 @@ Cannot call `React.useMemo` because function [1] requires another argument. [inc ^^^^^^^ References: - /react.js:533:34 + /react.js:518:34 v--- - 533| declare export function useMemo( - 534| create: () => T, - 535| inputs: ?$ReadOnlyArray, - 536| ): T; + 518| declare export function useMemo( + 519| create: () => T, + 520| inputs: ?$ReadOnlyArray, + 521| ): T; ---^ [1] @@ -1916,8 +1916,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -1930,8 +1930,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -1944,8 +1944,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -1958,8 +1958,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -1972,8 +1972,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -1986,8 +1986,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -2000,8 +2000,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -2014,8 +2014,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -2028,8 +2028,8 @@ Cannot call `React.useMutationEffect` because property `useMutationEffect` is mi ^^^^^^^^^^^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -2045,31 +2045,31 @@ Cannot call `React.useReducer` because: [incompatible-call] ^^^^^^^^^^ References: - /react.js:458:37 + /react.js:443:37 v------ - 458| declare export function useReducer( - 459| reducer: (S, A) => S, - 460| initialState: S, - 461| ): [S, Dispatch]; + 443| declare export function useReducer( + 444| reducer: (S, A) => S, + 445| initialState: S, + 446| ): [S, Dispatch]; ------------------^ [1] useReducer_hook.js:4:3 4| React.useReducer(); // Error: function requires another argument. ^^^^^^^^^^^^^^^^^^ [2] - /react.js:463:37 + /react.js:448:37 v------ - 463| declare export function useReducer( - 464| reducer: (S, A) => S, - 465| initialState: S, - 466| init: void, - 467| ): [S, Dispatch]; + 448| declare export function useReducer( + 449| reducer: (S, A) => S, + 450| initialState: S, + 451| init: void, + 452| ): [S, Dispatch]; ------------------^ [3] - /react.js:469:37 + /react.js:454:37 v--------- - 469| declare export function useReducer( - 470| reducer: (S, A) => S, - 471| initialArg: I, - 472| init: (I) => S, - 473| ): [S, Dispatch]; + 454| declare export function useReducer( + 455| reducer: (S, A) => S, + 456| initialArg: I, + 457| init: (I) => S, + 458| ): [S, Dispatch]; ------------------^ [4] @@ -2280,8 +2280,8 @@ References: useState_hook.js:5:42 5| const [count, setCount] = React.useState(1); ^^^^^^ [2] - /react.js:428:52 - 428| declare export type ReactSetStateFunction = ((S => S) | S) => void; + /react.js:413:52 + 413| declare export type ReactSetStateFunction = ((S => S) | S) => void; ^^^^^^ [3] diff --git a/tests/react/render.js b/tests/react/render.js index 2aed7b815c0..e9cb4c737bd 100644 --- a/tests/react/render.js +++ b/tests/react/render.js @@ -19,19 +19,19 @@ class B extends React.Component<{}, void> { /** * Basic render: stateless functional component tests */ -const C: React$StatelessFunctionalComponent<{}> = props => {}; -const D: React$StatelessFunctionalComponent<{}> = props => { +const C: React$AbstractComponent<{}> = props => {}; +const D: React$AbstractComponent<{}> = props => { return; }; -const E: React$StatelessFunctionalComponent<{}> = props => { +const E: React$AbstractComponent<{}> = props => { return null; }; ; -// Error: `React$StatelessFunctionalComponent` must return `React$Node` which can't be undefined +// Error: `React$AbstractComponent` must return `React$Node` which can't be undefined ; -// Error: `React$StatelessFunctionalComponent` must return `React$Node` which can't be undefined +// Error: `React$AbstractComponent` must return `React$Node` which can't be undefined ; // OK @@ -49,7 +49,7 @@ class F extends React.Component { /** * PropsType inference: stateless functional component test */ -const G: React$StatelessFunctionalComponent = props => { +const G: React$AbstractComponent = props => { return props.foo; }; // Error: props.foo could be undefined diff --git a/tests/react_16_3/react_16_3.exp b/tests/react_16_3/react_16_3.exp index 1886b09f349..00cb9d220f0 100644 --- a/tests/react_16_3/react_16_3.exp +++ b/tests/react_16_3/react_16_3.exp @@ -52,11 +52,11 @@ References: forwardRef.js:18:32 18| const badRef = React.createRef(); ^^^^^^^^^^^^^^ [2] - /react.js:274:6 - 274| ): {|current: null | T|}; + /react.js:261:6 + 261| ): {|current: null | T|}; ^^^^^^^^^^^^^^^^^^^^^ [3] - /react.js:178:6 - 178| | ((React$ElementRef | null) => mixed) + /react.js:165:6 + 165| | ((React$ElementRef | null) => mixed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] @@ -71,8 +71,8 @@ Cannot create `FancyButton` element because in property `ref`: [incompatible-typ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] References: - /react.js:177:5 - 177| | { -current: React$ElementRef | null, ... } + /react.js:164:5 + 164| | { -current: React$ElementRef | null, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] forwardRef.js:5:45 5| const FancyButton = React.forwardRef((props, ref) => ( @@ -104,11 +104,11 @@ References: forwardRef.js:41:57 41| const badUnionRef = React.createRef(); ^^^^^^^^^^^^^^ [3] - /react.js:274:6 - 274| ): {|current: null | T|}; + /react.js:261:6 + 261| ): {|current: null | T|}; ^^^^^^^^^^^^^^^^^^^^^ [4] - /react.js:178:6 - 178| | ((React$ElementRef | null) => mixed) + /react.js:165:6 + 165| | ((React$ElementRef | null) => mixed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [5] diff --git a/tests/react_16_6/react_16_6.exp b/tests/react_16_6/react_16_6.exp index ba173d827f6..fd6dad7cb4b 100644 --- a/tests/react_16_6/react_16_6.exp +++ b/tests/react_16_6/react_16_6.exp @@ -37,8 +37,8 @@ References: lazy.js:6:1 6| function FunctionComponent(x: Props): React.Node { return null } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /react.js:424:22 - 424| component: () => Promise<{ default: React$AbstractComponent, ... }>, + /react.js:409:22 + 409| component: () => Promise<{ default: React$AbstractComponent, ... }>, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -55,8 +55,8 @@ References: lazy.js:7:7 7| class ClassComponent extends React.Component {} ^^^^^^^^^^^^^^ [1] - /react.js:424:22 - 424| component: () => Promise<{ default: React$AbstractComponent, ... }>, + /react.js:409:22 + 409| component: () => Promise<{ default: React$AbstractComponent, ... }>, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -73,8 +73,8 @@ References: lazy.js:6:1 6| function FunctionComponent(x: Props): React.Node { return null } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /react.js:424:30 - 424| component: () => Promise<{ default: React$AbstractComponent, ... }>, + /react.js:409:30 + 409| component: () => Promise<{ default: React$AbstractComponent, ... }>, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] /core.js:1943:24 1943| declare class Promise<+R = mixed> { @@ -94,8 +94,8 @@ References: lazy.js:7:7 7| class ClassComponent extends React.Component {} ^^^^^^^^^^^^^^ [1] - /react.js:424:30 - 424| component: () => Promise<{ default: React$AbstractComponent, ... }>, + /react.js:409:30 + 409| component: () => Promise<{ default: React$AbstractComponent, ... }>, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] /core.js:1943:24 1943| declare class Promise<+R = mixed> { @@ -332,8 +332,8 @@ Cannot call `React.forwardRef` with `Demo` bound to `render` because in the seco ^^^^ References: - /react.js:403:12 - 403| ref: React$RefSetter, + /react.js:388:12 + 388| ref: React$RefSetter, ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] memo_ref.js:7:33 7| function Demo(props: {}, ref: ?({current: (T | null), ...} | ((inst: (T | null)) => mixed))) { diff --git a/tests/react_16_9/react_16_9.exp b/tests/react_16_9/react_16_9.exp index 231f4f432a6..23f9069f01e 100644 --- a/tests/react_16_9/react_16_9.exp +++ b/tests/react_16_9/react_16_9.exp @@ -8,8 +8,8 @@ Cannot get `React.ProfilerOnRenderFnType` because property `ProfilerOnRenderFnTy ^^^^^^^^^^^^^^^^^^^^^^ References: - /react.js:218:16 - 218| declare module react { + /react.js:205:16 + 205| declare module react { ^^^^^ [1] @@ -26,13 +26,13 @@ References: profiler.js:17:12 17| const _b = ; // Error, id and onRender are required ^^^^^^^^^^^^^^^^^^ [1] - /react.js:630:56 + /react.js:615:56 v- - 630| declare export var Profiler: React$AbstractComponent<{| - 631| +children?: React$Node, - 632| +id: string, - 633| +onRender: ProfilerOnRenderFnType, - 634| |}, void, React$Node>; + 615| declare export var Profiler: React$AbstractComponent<{| + 616| +children?: React$Node, + 617| +id: string, + 618| +onRender: ProfilerOnRenderFnType, + 619| |}, void, React$Node>; -^ [2] @@ -49,13 +49,13 @@ References: profiler.js:17:12 17| const _b = ; // Error, id and onRender are required ^^^^^^^^^^^^^^^^^^ [1] - /react.js:630:56 + /react.js:615:56 v- - 630| declare export var Profiler: React$AbstractComponent<{| - 631| +children?: React$Node, - 632| +id: string, - 633| +onRender: ProfilerOnRenderFnType, - 634| |}, void, React$Node>; + 615| declare export var Profiler: React$AbstractComponent<{| + 616| +children?: React$Node, + 617| +id: string, + 618| +onRender: ProfilerOnRenderFnType, + 619| |}, void, React$Node>; -^ [2] diff --git a/tests/react_abstract_component/react_abstract_component.exp b/tests/react_abstract_component/react_abstract_component.exp index 58b45d685fc..2287652a22d 100644 --- a/tests/react_abstract_component/react_abstract_component.exp +++ b/tests/react_abstract_component/react_abstract_component.exp @@ -131,8 +131,8 @@ Cannot return `x` because `React.Element` [1] is incompatible with number [2]. [ ^ References: - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [1] arity.js:25:43 25| ): React$AbstractComponent { @@ -148,8 +148,8 @@ Cannot return `x` because `React.Portal` [1] does not render number [2]. [incomp ^ References: - /react.js:210:21 - 210| declare opaque type React$Portal; + /react.js:197:21 + 197| declare opaque type React$Portal; ^^^^^^^^^^^^ [1] arity.js:25:43 25| ): React$AbstractComponent { @@ -470,11 +470,11 @@ References: create_element.js:23:32 23| const refBad = React.createRef(); ^^^^^^ [2] - /react.js:274:6 - 274| ): {|current: null | T|}; + /react.js:261:6 + 261| ): {|current: null | T|}; ^^^^^^^^^^^^^^^^^^^^^ [3] - /react.js:178:6 - 178| | ((React$ElementRef | null) => mixed) + /react.js:165:6 + 165| | ((React$ElementRef | null) => mixed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] @@ -489,11 +489,11 @@ Cannot create `C` element because in property `key`: [incompatible-type] ^^^^^^^^ [1] References: - /react.js:168:26 - 168| declare type React$Key = string | number; + /react.js:155:26 + 155| declare type React$Key = string | number; ^^^^^^ [2] - /react.js:168:35 - 168| declare type React$Key = string | number; + /react.js:155:35 + 155| declare type React$Key = string | number; ^^^^^^ [3] @@ -842,8 +842,8 @@ References: strict.js:4:11 4| const c = ; ^^^^^^^^^^^^^^^^^^^^ [1] - /react.js:149:29 - 149| | React$AbstractComponent; + /react.js:136:29 + 136| | React$AbstractComponent; ^^^^^ [2] @@ -875,8 +875,8 @@ Cannot call `foo` with `ref` bound to `a` because mixed [1] is incompatible with ^^^ References: - /react.js:149:36 - 149| | React$AbstractComponent; + /react.js:136:36 + 136| | React$AbstractComponent; ^^^^^ [1] strict.js:7:26 7| declare function foo(a: ?React$Component): void; diff --git a/tests/react_children/react_children.exp b/tests/react_children/react_children.exp index b32c299b678..b315a0804e4 100644 --- a/tests/react_children/react_children.exp +++ b/tests/react_children/react_children.exp @@ -138,8 +138,8 @@ Cannot call `s` with `Children.count(...)` bound to `x` because number [1] is in ^^^^^^^^^^^^^^^^^ References: - /react.js:388:42 - 388| count(children: ChildrenArray): number, + /react.js:373:42 + 373| count(children: ChildrenArray): number, ^^^^^^ [1] api.js:32:15 32| function s(x: string) {} @@ -1056,8 +1056,8 @@ References: tabs.js:10:7 10| class Tab extends React.Component<{}, void> {} ^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] tabs.js:18:5 18| | Array; // NOTE: This is intentionally `Array` and not @@ -1081,8 +1081,8 @@ References: tabs.js:10:7 10| class Tab extends React.Component<{}, void> {} ^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] tabs.js:68:9 68| ; // Error: We can only have tab components. @@ -1115,8 +1115,8 @@ References: tabs.js:10:7 10| class Tab extends React.Component<{}, void> {} ^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] tabs.js:73:3 73| diff --git a/tests/react_custom_funs/react_custom_funs.exp b/tests/react_custom_funs/react_custom_funs.exp index 15e14b20ee4..8613e8db1e6 100644 --- a/tests/react_custom_funs/react_custom_funs.exp +++ b/tests/react_custom_funs/react_custom_funs.exp @@ -23,8 +23,8 @@ object literal [1] is incompatible with `React.Element` [2]. [incompatible-type] ^^^^^^^^^^^^^ [1] References: - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -44,8 +44,8 @@ References: clone_element.js:26:39 26| (React.cloneElement(a): Element>); // Error: A ~> B ^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] @@ -65,8 +65,8 @@ References: clone_element.js:7:33 7| class B extends React.Component<{foo: number, bar: number}, void> {} ^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -276,8 +276,8 @@ Cannot call `React.cloneElement` because props [1] is incompatible with empty [2 ^^ [1] References: - /react.js:149:29 - 149| | React$AbstractComponent; + /react.js:136:29 + 136| | React$AbstractComponent; ^^^^^ [2] @@ -293,8 +293,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -310,8 +310,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -327,8 +327,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -344,8 +344,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -361,8 +361,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -378,8 +378,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -395,8 +395,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -412,8 +412,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -429,8 +429,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -446,8 +446,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -463,8 +463,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -480,8 +480,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -497,8 +497,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -514,8 +514,8 @@ References: clone_element.js:99:21 99| declare const el: React.Node; ^^^^^^^^^^ [1] - /react.js:160:21 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:21 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^^^ [2] @@ -546,11 +546,11 @@ Cannot instantiate `React.Element` because in type argument `ElementType`: [inco ^^ [1] References: - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [2] - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] @@ -573,11 +573,11 @@ Cannot instantiate `React.Element` because in type argument `ElementType`: [inco ^^ [1] References: - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [2] - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] @@ -600,11 +600,11 @@ Cannot instantiate `React.Element` because in type argument `ElementType`: [inco ^^ [1] References: - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [3] @@ -804,8 +804,8 @@ References: create_element.js:34:74 34| (React.createElement(A, {foo: 1, bar: 2}): React.Element, {foo: boolean, bar: number}>); // error ^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -825,8 +825,8 @@ References: create_element.js:35:74 35| (React.createElement(B, {foo: 1, bar: 2}): React.Element); // error ^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -2116,8 +2116,8 @@ References: create_element.js:215:46 215| (React.createElement(M): React.Element, any>); // Error ^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] @@ -2323,8 +2323,8 @@ References: create_factory.js:36:60 36| (aFactory({foo: 1, bar: 2}): React$Element, {foo: boolean, bar: number}>); // Error: `foo` is `number`. ^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -2344,8 +2344,8 @@ References: create_factory.js:37:60 37| (bFactory({foo: 1, bar: 2}): React$Element); // Error: `foo` is `number`. ^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -3574,8 +3574,8 @@ References: create_factory.js:216:34 216| (mFactory(): React$Element>); // Error ^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] diff --git a/tests/react_experimental/react_experimental.exp b/tests/react_experimental/react_experimental.exp index db87691d1a5..d19be4d393f 100644 --- a/tests/react_experimental/react_experimental.exp +++ b/tests/react_experimental/react_experimental.exp @@ -7,8 +7,8 @@ Cannot call `React.startTransition` because function [1] requires another argume ^^^^^^^^^^^^^^^ References: - /react.js:571:42 - 571| declare export function startTransition(() => void): void; + /react.js:556:42 + 556| declare export function startTransition(() => void): void; ^^^^^^^^^^^^^^^^^^ [1] @@ -21,8 +21,8 @@ Cannot call `React.useDeferredValue` because no more than 1 argument is expected ^^ References: - /react.js:556:43 - 556| declare export function useDeferredValue(value: T): T; + /react.js:541:43 + 541| declare export function useDeferredValue(value: T): T; ^^^^^^^^^^^^^^^^ [1] @@ -35,8 +35,8 @@ Cannot call `React.useTransition` because no arguments are expected by function ^^ References: - /react.js:564:40 - 564| declare export function useTransition(): [boolean, (() => void) => void]; + /react.js:549:40 + 549| declare export function useTransition(): [boolean, (() => void) => void]; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] @@ -49,8 +49,8 @@ Cannot cast `isPending` to function type because boolean [1] is incompatible wit ^^^^^^^^^ References: - /react.js:564:45 - 564| declare export function useTransition(): [boolean, (() => void) => void]; + /react.js:549:45 + 549| declare export function useTransition(): [boolean, (() => void) => void]; ^^^^^^^ [1] useTransition_hook.js:12:13 12| (isPending: (() => void) => void); // Error: boolean is incompatible with function type @@ -66,8 +66,8 @@ Cannot cast `startTransition` to boolean because function type [1] is incompatib ^^^^^^^^^^^^^^^ References: - /react.js:564:54 - 564| declare export function useTransition(): [boolean, (() => void) => void]; + /react.js:549:54 + 549| declare export function useTransition(): [boolean, (() => void) => void]; ^^^^^^^^^^^^^^^^^^^^ [1] useTransition_hook.js:13:19 13| (startTransition: boolean); // Error: function type is incompatible with boolean @@ -83,8 +83,8 @@ Cannot call `startTransition` because function [1] requires another argument. [i ^^^^^^^^^^^^^^^ References: - /react.js:564:54 - 564| declare export function useTransition(): [boolean, (() => void) => void]; + /react.js:549:54 + 549| declare export function useTransition(): [boolean, (() => void) => void]; ^^^^^^^^^^^^^^^^^^^^ [1] diff --git a/tests/react_functional/react_functional.exp b/tests/react_functional/react_functional.exp index 619a1d08512..762fd088af8 100644 --- a/tests/react_functional/react_functional.exp +++ b/tests/react_functional/react_functional.exp @@ -57,11 +57,11 @@ References: test.js:16:9 16| var Z = 0; ^ [1] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [2] - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] diff --git a/tests/react_functional/test.js b/tests/react_functional/test.js index bbbb69506d0..13c9be5cbe6 100644 --- a/tests/react_functional/test.js +++ b/tests/react_functional/test.js @@ -16,8 +16,8 @@ function G(props: { foo: string | number }) { var Z = 0; ; // error, expected React component -// Ensure StatelessFunctionalComponent type is usable -const H: React.StatelessFunctionalComponent<{ foo: string }> = props => { +// Ensure AbstractComponent type is usable +const H: React.AbstractComponent<{ foo: string }> = props => { return null; }; ; // ok diff --git a/tests/react_imports/react_imports.exp b/tests/react_imports/react_imports.exp index 7cf8e38ebee..addf1e3c16c 100644 --- a/tests/react_imports/react_imports.exp +++ b/tests/react_imports/react_imports.exp @@ -80,8 +80,8 @@ Cannot get `React.Node` because property `Node` is missing in object type [1]. [ ^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -94,8 +94,8 @@ Cannot get `React.Node` because property `Node` is missing in object type [1]. [ ^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -108,8 +108,8 @@ Cannot get `React.Missing` because property `Missing` is missing in object type ^^^^^^^ References: - /react.js:679:26 - 679| declare export default typeof React; + /react.js:664:26 + 664| declare export default typeof React; ^^^^^^^^^^^^ [1] @@ -163,8 +163,8 @@ Cannot get `React.Missing` because property `Missing` is missing in module `reac ^^^^^^^ References: - /react.js:218:16 - 218| declare module react { + /react.js:205:16 + 205| declare module react { ^^^^^ [1] diff --git a/tests/react_runtime_automatic/react_runtime_automatic.exp b/tests/react_runtime_automatic/react_runtime_automatic.exp index 21dbc53f726..d2ceefad8dc 100644 --- a/tests/react_runtime_automatic/react_runtime_automatic.exp +++ b/tests/react_runtime_automatic/react_runtime_automatic.exp @@ -50,8 +50,8 @@ References: test.js:5:28 5| function Component2(props: {| bar: number |}): React$Node { return null } ^^^^^^^^^^^^^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -71,8 +71,8 @@ References: test.js:4:27 4| function Component(props: Props): React$Node { return null } ^^^^^ [2] - /react.js:160:69 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:69 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^ [3] @@ -92,8 +92,8 @@ References: test.js:5:28 5| function Component2(props: {| bar: number |}): React$Node { return null } ^^^^^^^^^^^^^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] @@ -113,8 +113,8 @@ References: test.js:4:27 4| function Component(props: Props): React$Node { return null } ^^^^^ [2] - /react.js:160:36 - 160| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; + /react.js:147:36 + 147| declare opaque type React$Element<+ElementType: React$ElementType, +P = React$ElementProps>: {...}; ^^^^^^^^^^^ [3] diff --git a/tests/render_types/render_types.exp b/tests/render_types/render_types.exp index fa1901cba0d..91391611470 100644 --- a/tests/render_types/render_types.exp +++ b/tests/render_types/render_types.exp @@ -550,8 +550,8 @@ Cannot cast `rendersFooOrBar` to empty because `React.Element` [1] is incompatib ^^^^^^^^^^^^^^^ References: - /react.js:162:35 - 162| declare type React$MixedElement = React$Element; + /react.js:149:35 + 149| declare type React$MixedElement = React$Element; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] renders_to_renders.js:116:22 116| rendersFooOrBar as empty; // ERROR @@ -812,8 +812,8 @@ Cannot get `rendersFooOrBar.props` because property `props` is missing in `React ^^^^^ References: - /react.js:162:35 - 162| declare type React$MixedElement = React$Element; + /react.js:149:35 + 149| declare type React$MixedElement = React$Element; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] @@ -938,8 +938,8 @@ Cannot cast `rendersBaz` to empty because `React.Element` [1] is incompatible wi ^^^^^^^^^^ References: - /react.js:162:35 - 162| declare type React$MixedElement = React$Element; + /react.js:149:35 + 149| declare type React$MixedElement = React$Element; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] renders_to_renders.js:130:17 130| rendersBaz as empty; // ERROR @@ -955,8 +955,8 @@ Cannot get `rendersBaz.props` because property `props` is missing in `React.Elem ^^^^^ References: - /react.js:162:35 - 162| declare type React$MixedElement = React$Element; + /react.js:149:35 + 149| declare type React$MixedElement = React$Element; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] diff --git a/tests/strict_es6_import_export/strict_es6_import_export.exp b/tests/strict_es6_import_export/strict_es6_import_export.exp index 641b090c454..bbf3d20154c 100644 --- a/tests/strict_es6_import_export/strict_es6_import_export.exp +++ b/tests/strict_es6_import_export/strict_es6_import_export.exp @@ -263,11 +263,11 @@ Cannot instantiate `React.Element` because in type argument `ElementType`: [inco References: foo.js ^^^^^^ [1] - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [3] 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 9e76e3f0910..7b9a3c6c35f 100644 --- a/tests/type_at_pos_react/type_at_pos_react.exp +++ b/tests/type_at_pos_react/type_at_pos_react.exp @@ -21,7 +21,7 @@ react_component.js:31:7 = { "expanded":{ "kind":"Generic", "type":{ - "provenance":{"kind":"Library (Remote)","loc":"[LIB] react.js:212:14-31"}, + "provenance":{"kind":"Library (Remote)","loc":"[LIB] react.js:199:14-31"}, "name":"React$FragmentType" }, "generic_kind":"type alias" @@ -50,7 +50,7 @@ react_component.js:32:13 = { "kind":"Generic", "typeArgs":[{"kind":"Num"}], "type":{ - "provenance":{"kind":"Library (Remote)","loc":"[LIB] react.js:311:23-35"}, + "provenance":{"kind":"Library (Remote)","loc":"[LIB] react.js:296:23-35"}, "name":"ComponentType" }, "generic_kind":"type alias" @@ -78,7 +78,7 @@ react_component.js:32:29 = { "expanded":{ "kind":"TypeAlias", "name":{ - "provenance":{"kind":"Library (Remote)","loc":"[LIB] react.js:311:23-35"}, + "provenance":{"kind":"Library (Remote)","loc":"[LIB] react.js:296:23-35"}, "name":"ComponentType" }, "typeParams":[{"name":"P","bound":null,"polarity":"Negative"}], @@ -86,7 +86,7 @@ react_component.js:32:29 = { "kind":"Generic", "typeArgs":[{"kind":"Bound","bound":"P"}], "type":{ - "provenance":{"kind":"Library (Remote)","loc":"[LIB] react.js:137:14-32"}, + "provenance":{"kind":"Library (Remote)","loc":"[LIB] react.js:124:14-32"}, "name":"React$ComponentType" }, "generic_kind":"type alias" diff --git a/tests/unsupported_spread_args/unsupported_spread_args.exp b/tests/unsupported_spread_args/unsupported_spread_args.exp index edff520598a..939765ceb16 100644 --- a/tests/unsupported_spread_args/unsupported_spread_args.exp +++ b/tests/unsupported_spread_args/unsupported_spread_args.exp @@ -12,11 +12,11 @@ References: test.js:4:14 4| const arr = [1,2,3]; // badly-positioned error ^ [1] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [2] - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] @@ -62,11 +62,11 @@ References: test.js:4:14 4| const arr = [1,2,3]; // badly-positioned error ^ [1] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [2] - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] @@ -126,11 +126,11 @@ References: test.js:4:14 4| const arr = [1,2,3]; // badly-positioned error ^ [1] - /react.js:148:5 - 148| | string + /react.js:135:5 + 135| | string ^^^^^^ [2] - /react.js:149:5 - 149| | React$AbstractComponent; + /react.js:136:5 + 136| | React$AbstractComponent; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3]