-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow] Use of
React$Node
will now trigger internal-type error
Summary: Changelog: [errors] Use of `React$Node` and `React$MixedElement` outside of libdefs will now trigger `internal-type` errors. Reviewed By: gkz Differential Revision: D67542053 fbshipit-source-id: 0e19097114d4fc7281fe89c5872fc6efd5855807
- Loading branch information
1 parent
192b8b1
commit 09003fe
Showing
12 changed files
with
53 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// This test requires builtins to be properly loaded in the post-inference pass | ||
function foo<X>(x: ExactReactElement_DEPRECATED<X>): void {}; | ||
declare var x: React$Node; | ||
declare var x: React.Node; | ||
// $FlowExpectedError | ||
foo(x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
//@flow | ||
const React = require('react'); | ||
function Component(): React$Node { return null; } | ||
function Component(): React.Node { return null; } | ||
|
||
const _a = <Component foo={3} bar={3} />; | ||
const _b = <Component>{"foo"}</Component>; | ||
const _b2 = <Component></Component>; | ||
|
||
type Props = {||} | ||
function Component2(props : Props) : React$Node { return null; } | ||
function Component2(props : Props) : React.Node { return null; } | ||
|
||
const _c = <Component2 foo={3} bar={3} />; // error | ||
const _d = <Component2>{"foo"}</Component2>; //error | ||
|
||
function Component3(props : { }) : React$Node { return null; } | ||
function Component3(props : { }) : React.Node { return null; } | ||
|
||
const _e = <Component3 foo={3} bar={3} />; | ||
const _f = <Component3>{"foo"}</Component3>; | ||
|
||
function Component4(props : {| foo : number |}) : React$Node { return null; } | ||
function Component4(props : {| foo : number |}) : React.Node { return null; } | ||
|
||
const _g = <Component4 foo={3} bar={3} />; //error | ||
const _h = <Component4></Component4>; //error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters