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