diff --git a/tests/facebook_fbs_none/main.js b/tests/facebook_fbs_none/main.js index c4e8793f86f..c5336425026 100644 --- a/tests/facebook_fbs_none/main.js +++ b/tests/facebook_fbs_none/main.js @@ -1,3 +1,3 @@ var React = require('react'); -(: React$MixedElement); +(: React.MixedElement); (: number); // Error: ReactElement ~> number diff --git a/tests/facebook_fbt_none/main.js b/tests/facebook_fbt_none/main.js index f2c57c7ef86..8485ec61c5d 100644 --- a/tests/facebook_fbt_none/main.js +++ b/tests/facebook_fbt_none/main.js @@ -1,3 +1,3 @@ var React = require('react'); -(: React$MixedElement); +(: React.MixedElement); (: number); // Error: ReactElement ~> number diff --git a/tests/react_abstract_component/strict.js b/tests/react_abstract_component/strict.js index dd27a579573..bed1f109c1b 100644 --- a/tests/react_abstract_component/strict.js +++ b/tests/react_abstract_component/strict.js @@ -2,7 +2,7 @@ const React = require('react'); declare var Component : React$ElementType; const c = ; -(c : React$MixedElement); +(c : React.MixedElement); declare function foo(a: ?React$Component): void; declare var ref: ?React.ElementRef; @@ -10,7 +10,7 @@ foo(ref); class Component2 extends React.Component<{}> {}; const d = ; -(d: React$MixedElement); +(d: React.MixedElement); type Props = {someProp : string}; type State = {}; @@ -18,7 +18,7 @@ type State = {}; class MyComponent extends React.Component { static _cloneElement( element: ExactReactElement_DEPRECATED, - ): React$MixedElement { + ): React.MixedElement { const someProp = 'some value'; return React.cloneElement(element, {someProp}); } @@ -26,4 +26,4 @@ class MyComponent extends React.Component { declare var e : ExactReactElement_DEPRECATED>; -(e : React$MixedElement); +(e : React.MixedElement); diff --git a/tests/react_jsx/test.js b/tests/react_jsx/test.js index b2bfebe08c6..16ce17a596e 100644 --- a/tests/react_jsx/test.js +++ b/tests/react_jsx/test.js @@ -950,7 +950,7 @@ const EnhancedClass_DefaultProps = hoc(Class_DefaultProps); foo={1} />; -class ThisInJsxTag extends React.Component<{tag: () => React$MixedElement}> { +class ThisInJsxTag extends React.Component<{tag: () => React.MixedElement}> { render(): React.Node { return ; // OK } diff --git a/tests/render_types/render_types.exp b/tests/render_types/render_types.exp index 6f92f29a0c1..b42359d7b2b 100644 --- a/tests/render_types/render_types.exp +++ b/tests/render_types/render_types.exp @@ -963,7 +963,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. Only elemen appear in renders but string [2] is not a component-syntax component. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -978,7 +978,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. You can onl when the third type argument is a render type and undefined [2] is not a render type. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -993,7 +993,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. You can onl when the third type argument is a render type and null [2] is not a render type. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -1008,7 +1008,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. You can onl when the third type argument is a render type and boolean [2] is not a render type. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -1023,7 +1023,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. You can onl when the third type argument is a render type and number [2] is not a render type. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -1038,7 +1038,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. You can onl when the third type argument is a render type and string [2] is not a render type. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -1053,7 +1053,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. You can onl when the third type argument is a render type and `React.Element` [2] is not a render type. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -1068,7 +1068,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. You can onl when the third type argument is a render type and `React.Portal` [2] is not a render type. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -1083,7 +1083,7 @@ Cannot use `React.Element` [1] as the type argument of renders type. You can onl when the third type argument is a render type and `$Iterable` [2] is not a render type. [invalid-render] renders_to_renders.js:60:25 - 60| rendersFoo as renders React$MixedElement; // type checks, but invalid-render + 60| rendersFoo as renders React.MixedElement; // type checks, but invalid-render ^^^^^^^^^^^^^^^^^^ [1] References: @@ -1290,7 +1290,7 @@ Cannot cast `mixedElement` to renders union type because `React.Element` [1] doe References: renders_to_renders.js:105:31 - 105| declare const mixedElement: React$MixedElement; + 105| declare const mixedElement: React.MixedElement; ^^^^^^^^^^^^^^^^^^ [1] renders_to_renders.js:107:19 v-------- diff --git a/tests/render_types/renders_to_renders.js b/tests/render_types/renders_to_renders.js index bee2acfed35..d6904262a72 100644 --- a/tests/render_types/renders_to_renders.js +++ b/tests/render_types/renders_to_renders.js @@ -57,7 +57,7 @@ declare const rendersBazOrBaz: renders ( | null // invalid-render | Bar ); // OK - rendersFoo as renders React$MixedElement; // type checks, but invalid-render + rendersFoo as renders React.MixedElement; // type checks, but invalid-render rendersQux as renders (Foo | Bar); // OK rendersQux as renders (Foo | Baz); // ERROR component A0() renders null { // invalid-render @@ -102,7 +102,7 @@ declare const rendersBazOrBaz: renders ( 3 as renders (null | number); // type checks, but invalid-render declare const x: ExactReactElement_DEPRECATED<() => React$Node>; x as renders typeof x; // type checks, but invalid-render - declare const mixedElement: React$MixedElement; + declare const mixedElement: React.MixedElement; // The test below ensures repositioning does not hit unsoundness in speculation mixedElement as renders ( | Foo @@ -114,11 +114,11 @@ declare const rendersBazOrBaz: renders ( /* Exit Structural Render Types */ { - rendersFooOrBar as React$MixedElement; // OK + rendersFooOrBar as React.MixedElement; // OK rendersFooOrBar as empty; // ERROR rendersFooOrBar as React$Node; // OK rendersFooOrBar as React$Node; // OK - rendersNode as React$MixedElement; // invalid-render of rendersNode makes LHS any + rendersNode as React.MixedElement; // invalid-render of rendersNode makes LHS any rendersNode as React$Node; // OK declare const rendersNullOrNull: renders (null | null); // invalid-render rendersNullOrNull as null; // invalid-render of rendersNullOrNull makes LHS any @@ -128,7 +128,7 @@ declare const rendersBazOrBaz: renders ( /* Exit Nominal Render Types */ { - rendersBaz as React$MixedElement; // OK + rendersBaz as React.MixedElement; // OK rendersBaz as empty; // ERROR rendersBaz.props; // ERROR }