defineSpan
defineSpan<
TType>(config):Span
Defined in: packages/editor/src/renderers/renderer.types.ts:333
Define a span renderer. The returned registration is mounted via the
<NodePlugin> component at the top level, or nested inside a
container’s of array as a positional override.
type is required even though there is only one top-level span type
('span') today. Keeping type required leaves the door open for
positional overrides of span-like inlines (e.g. a code-span inside
a code-block container).
Type Parameters
Section titled “Type Parameters”TType extends string
Parameters
Section titled “Parameters”config
Section titled “config”render?
Section titled “render?”SpanRender | null
TType extends "block" ? "Error: defineSpan({type: 'block'}) is forbidden -- 'block' is always a text block, use defineTextBlock" : TType
Returns
Section titled “Returns”Example
Section titled “Example”defineSpan({ type: 'span', render: ({attributes, children}) => ( <span {...attributes}>{children}</span> ),})