Commit 8d65c82
committed
lib: Make DynamicListForm.itemcomponent a component type instead of instance
Existing callers in podman/machines used it like that:
<DynamicListForm ... itemcomponent={ <PublishPort />} />
But from a conceptual as well as type-check perspective this is
nonsense: This is a totally invalid object as it does not get any
(required) properties. It needlessly runs initialization, and can never
actually get rendered. Running typechecker on this rightfully complained
about
> src/ImageRunModal.jsx(1062,51): error TS2740:
> Type '{}' is missing the following properties from type '{ id: any; item: any; ...
Change this to specify the type, so that it can be instantiated
properly with `React.createElement()`.
Existing callers in podman/machines have to be changed to
<DynamicListForm ... itemcomponent={PublishPort} />1 parent 5d3ac37 commit 8d65c82
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
0 commit comments