FieldTransforms
Transform the data for each field type before rendering in the editor.
const fieldTransforms = {
text: ({ value }) => <p>{value}</p>,
// ...
};
You can specify a custom render method for each known field type, or introduce completely new ones.
Render Props
Prop | Example | Type |
---|---|---|
componentId | "Heading-12345" | string |
field | { type: "text" } | Field |
isReadOnly | false | boolean |
propName | "title" | string |
propPath | "obj.arr[2].title" | string |
value | "Value" | any |
componentId
The id of the component containing this prop
field
The component’s field definition for this prop.
isReadOnly
Whether or not this field is currently set to read-only.
propName
The name of this prop provided to the component field config.
propPath
The path of this prop within the props object.
Use in conjunction with the setDeep
utility to set data for a key deep within an object or array, normally ComponentData.
value
The value of the prop.