onSelect

🤖 This is not Slate's internal selection representation. If you want to get notified when Slate's value.selection changes, use the onChange property of the <Editor>. This handler is instead meant to give you lower-level access to the DOM selection handling, which is not always triggered as you'd expect.

renderEditor

The renderEditor property allows you to define higher-order-component-like behavior. It is passed all of the properties of the editor, including children, which you can access as next(). You can then choose to wrap the existing children in any custom elements or proxy the properties however you choose. Note, that multiple plugins can define renderEditor and each one can add a specific behaviour to the editor, as next() refers to children from another plugin in the stack. This can be useful for rendering toolbars, styling the editor, rendering validation, etc, and each plugin can be responsible for a given functionality only, keeping your code dry and well organized. Just remember that the renderEditor function has to render children for editor's content to render. For example:

You must spread the props.attributes onto the top-level DOM node you use to render the node. You must also be sure to assign attributes.ref to the native DOM component being rendered (using forwardRef or innerRef if necessary).

You must spread the props.attributes onto the top-level DOM node you use to render the node. You must also be sure to assign attributes.ref to the native DOM component being rendered (using forwardRef or innerRef if necessary).