fieldTypes
Override each field type.
const overrides = {
fieldType: {
number: ({ name }) => <input name={name} type="number" />,
text: ({ name }) => <input name={name} type="text" />,
// ...
},
};You can specify a custom render method for each known field type, or introduce completely new ones.
Render Props
| Prop | Example | Type |
|---|---|---|
children | <input /> | ReactNode |
field | { type: "text" } | Field |
id | "my-input" | String |
label | "Title" | String |
name | "title" | String |
onChange | onChange("Goodbye, world") | Function |
readOnly | false | Boolean |
readOnlyFields | { title: true } | Object |
value | "Hello, world" | Any |
children
The default node for this field type.
field
An object containing the user defined Field configuration.
id
A unique ID for this field.
label
The label for this field.
name
The name of the prop this field is rendering for.
onChange
A callback to set a new value for this input.
readOnly
A boolean describing whether or not this field is set to readOnly by resolveData.
readOnlyFields
An object describing all fields that are currently set to readOnly by resolveData.
value
The current value for the prop.