This repository was archived by the owner on Feb 6, 2023. It is now read-only.
Commit a1f4593
React.Element<any> / React.Element<*> -> React.Node as much as possible
Summary:
Most of the time when people annotate something with `React.Element<any>` or `React.Element<*>` they don't really care about it really being a React element, and would be just as happy with `React.Node`. The exceptions I encountered when writing this diff were:
1) places where people do `React.cloneElement` -- in that case we of course need an element
2) components that want some of the props or children to be a certain component type -- but in those cases we ought to specify the type of element rather than accepting `any` or `*`
As such, it's reasonable to replace `React.Element<any>` and `React.Element<*>` if doing so does not cause any Flow errors, and this should put a noticeable dent in our usage of unsafe Flow types.
Reviewed By: camspiers, stryju
Differential Revision: D7810983
fbshipit-source-id: d28f645a63cdfbae74370817e36c5bf590f543d61 parent d2a3ae8 commit a1f4593
File tree
4 files changed
+4
-4
lines changed- src
- component
- base
- contents
- model
- decorators
- immutable
4 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
0 commit comments