DecoratorRenderProps
DecoratorRenderProps =
object
Defined in: packages/editor/src/renderers/renderer.types.ts:90
A decorator’s render function. Receives the decorator name and
wraps the styled text it applies to. Range and selection decorations
can split one span into several leaves, so this fires once per
decorator on each leaf, not once per span, nested in the span’s
marks order.
The render is a plain function call, not a component: do not call
hooks in it. When you need hooks, return an element of your own
component: render: (props) => <MyDecorator {...props} />.
Properties
Section titled “Properties”children
Section titled “children”children:
ReactElement
Defined in: packages/editor/src/renderers/renderer.types.ts:91
decorator
Section titled “decorator”decorator:
string
Defined in: packages/editor/src/renderers/renderer.types.ts:96
The decorator name, e.g. 'strong'. A '*' render
discriminates on this.
focused
Section titled “focused”focused:
boolean
Defined in: packages/editor/src/renderers/renderer.types.ts:97
path:
Path
Defined in: packages/editor/src/renderers/renderer.types.ts:101
Path of the span carrying the decorator.
readOnly
Section titled “readOnly”readOnly:
boolean
Defined in: packages/editor/src/renderers/renderer.types.ts:102
renderDefault()
Section titled “renderDefault()”renderDefault: (
props) =>ReactElement
Defined in: packages/editor/src/renderers/renderer.types.ts:109
Render this position with the engine’s default wrapper. See ContainerRenderProps.renderDefault. The default is identity: the engine applies no decorator markup of its own.
Parameters
Section titled “Parameters”DecoratorRenderProps
Returns
Section titled “Returns”ReactElement
selected
Section titled “selected”selected:
boolean
Defined in: packages/editor/src/renderers/renderer.types.ts:103