Merge pull request #475 from raunofreiberg/react-flow-minimal
[flow] modify minimal example to typing React components
This commit is contained in:
commit
bb9034d9ef
15
flow.md
15
flow.md
|
@ -325,13 +325,16 @@ function add(n /*: number */) { ... }
|
||||||
### React
|
### React
|
||||||
|
|
||||||
```js
|
```js
|
||||||
React$Element<any>
|
type Props = {
|
||||||
```
|
bar: number,
|
||||||
|
}
|
||||||
|
|
||||||
```js
|
type State = {
|
||||||
class Foo extends React.Component {
|
open: boolean,
|
||||||
/*:: state: { open: boolean } */
|
}
|
||||||
/*:: props: { open: boolean } */
|
|
||||||
|
class Foo extends React.Component<Props, State> {
|
||||||
|
// Component code
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue