Open
Description
Let me know if you want a PR...I think we need to investigate workarounds before we proceed...
I'm getting errors like this:
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/universal/components/CalibrationForm/index.js:119:10
Cannot create FieldArray element because property defaultValue is missing in object type [1] but exists in props [2].
src/universal/components/CalibrationForm/index.js
116│
117│ if (isInCalibration) {
118│ return (
[2] 119│ <FieldArray
120│ name="points"
121│ key={numPoints + 1}
122│ validate={validatePoints}
123│ render={props => (
124│ <CalibrationTable
125│ {...props}
126│ units={units}
127│ rawInputUnits={rawInputUnits}
128│ bodyClass={classes.body}
129│ />
130│ )}
131│ />
node_modules/react-final-form-arrays/dist/types.js.flow
[1] 43│ export type RenderableProps<T> = $Shape<{
44│ children: (props: T) => React.Node,
45│ component: React.ComponentType<*>,
46│ render: (props: T) => React.Node
47│ }>
Problem is here:
react-final-form-arrays/src/types.js.flow
Line 57 in 16f19c5
Intersecting inexact shape types in Flow has always caused problems like this sporadically.
It seems like this appears to work, though I don't trust it until I've played with it more:
type FieldArrayProps = { name: string, ...$Exact<UseFieldArrayConfig>, ...$Exact<RenderableProps<FieldArrayProps>> }
I don't trust it until I've played with it more though, because I remember seeing inexact spreads like { name: string, ...UseFieldArrayConfig }
produce buggy errors (facebook/flow#1326 (comment)).
Metadata
Metadata
Assignees
Labels
No labels