Created
December 4, 2016 19:47
-
-
Save jeffmo/035498c44ad9595bd06160a07df76667 to your computer and use it in GitHub Desktop.
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
/* flow-typed/lib.js */ | |
type JSXHelper<T> = Class<React$Component<{}, T, any>>; | |
// $JSXIntrinsics is special and magic. | |
// This declares the types for `div` and `span` | |
type $JSXIntrinsics = { | |
div: JSXHelper<{id: string}>, | |
span: JSXHelper<{id: string, class: string}>, | |
}; |
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
// @flow | |
let myDiv = <div id={42} />; |
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
> flow version | |
Flow, a static type checker for JavaScript, version 0.36.0 | |
> flow check | |
main.js:3 | |
3: let myDiv = <div id={42} />; | |
^^^^^^^^^^^^^^^ React element `div` | |
3: let myDiv = <div id={42} />; | |
^^ number. This type is incompatible with | |
6: div: JSXHelper<{id: string}>, | |
^^^^^^ string. See lib: flow-typed/lib.js:6 | |
Found 1 error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment