[flow] modify minimal example to typing React components

This commit is contained in:
raunofreiberg 2018-03-29 14:19:18 +03:00
parent 9bb866cf36
commit 545c82fc89
1 changed files with 9 additions and 6 deletions

15
flow.md
View File

@ -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
} }
``` ```