docs/api/core/plate-components.mdx
Plate is the root component loading the editor state into a store provider.
PlateContent is the component that renders the editor.
<Plate>Parameters:
editor: The Plate editor instancenode: The node after the operationoperation: The node operation that occurredprevNode: The node before the operationNote: For insert_node and remove_node operations, both node and prevNode contain the same value to avoid null cases.
</APIItem>
<APIItem name="onTextChange" type="(options: { editor: PlateEditor; node: Descendant; operation: TextOperation; prevText: string; text: string }) => void" optional>
Callback called whenever a text operation occurs (insert or remove text).
Parameters:
editor: The Plate editor instancenode: The parent node (block or inline element) containing the text that changedoperation: The text operation that occurred (insert_text or remove_text)prevText: The text content before the operationtext: The text content after the operationtrue
</APIItem>
<PlateContent><Editable {...props} />
</APIItem>
Plate requires an editor prop, which should be an instance of PlateEditor. If editor is null, Plate will not render anything.
The Plate component does not handle the creation of the editor or the management of plugins. These responsibilities are handled by createPlateEditor.
Plate provides a store for the editor state and renders its children. It uses PlateStoreProvider to make the editor state and related functions available to its children components.
The rendering logic for elements and leaves is primarily handled by the plugins system, with renderElement and renderLeaf props serving as fallbacks if no plugin is found for a specific node type.
For more details on creating and configuring the editor, refer to the Editor Configuration guide.