Commit 2c68067
authored
Fix: Fix missing FlowType enum values in prop description (#1571)
In `ef4c109b`, the file `PropsRenderer.js` (located at
`src/client/rsg-components/Props/PropsRenderer.js`) was removed. In
`PropsRenderer.js`, the `renderExtra` method checked whether `getType`
for the argument to `renderExtra` was present:
```es6
function renderExtra(prop) {
const type = getType(prop);
if (!type) {
return null;
}
...
}
```
However, in `ef4c109b`, this method was replaced with `renderExtra.tsx`
and the condition was changed to:
```typescript
export default function renderExtra(prop: PropDescriptorWithFlow): React.ReactNode {
const type = getType(prop);
if (!prop.type || !type) {
return null;
}
```
Unfortunately, this extra condition has resulted in this method always
returning `null` for a Flow typed prop as `prop.type` is always `null`
as `prop.type` is never set.
This commit reverts the condition to what it was before the migration to
TypeScript.1 parent b03c207 commit 2c68067
File tree
2 files changed
+26
-24
lines changed- src/client/rsg-components/Props
2 files changed
+26
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
615 | 624 | | |
616 | 625 | | |
617 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
| |||
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 28 | + | |
36 | 29 | | |
37 | 30 | | |
38 | 31 | | |
| |||
68 | 61 | | |
69 | 62 | | |
70 | 63 | | |
71 | | - | |
| 64 | + | |
72 | 65 | | |
73 | 66 | | |
74 | 67 | | |
75 | 68 | | |
76 | | - | |
| 69 | + | |
77 | 70 | | |
78 | | - | |
| 71 | + | |
79 | 72 | | |
80 | | - | |
| 73 | + | |
81 | 74 | | |
82 | 75 | | |
83 | | - | |
| 76 | + | |
84 | 77 | | |
85 | 78 | | |
86 | 79 | | |
87 | 80 | | |
88 | | - | |
| 81 | + | |
89 | 82 | | |
90 | 83 | | |
91 | 84 | | |
| |||
0 commit comments