<Editor />
Component
Creates the context that stores the editor state.
#
Reference#
Propsresolver
Map<String, React.ComponentType>A map of User Components that will be used in the editorenabled?
booleanOptional. If set to false, all editing capabilities will be disabledindicator?
Record<"success" | "error", String>Optional. The colour to use for the drop indicator. The colour set in 'success' will be used when the indicator shows a droppable location; otherwise the colour set in 'error' will be used.onRender?
React.ComponentType<{element: React.ReactElement}>Optional. Specify a custom component to render every User Element in the editor.onNodesChange?
(query: QueryMethods) => voidOptional. A callback method when the values of any of the nodes in the state changes
#
Examples#
Custom render user elementsBy default, every user element is rendered just as it is. However, if you'd like to, for example, wrap every user element inside a div
, you can do so through the onRender
prop:
In the above example, every user element will now be wrapped in a black div
.
#
Specifying the Drop Indicator colourYou could change the colours of the drag and drop indicators like so:
#
Callback when Nodes changePerform a callback whenever the Nodes in the editor is updated/changed