AnnotationRenderProps
AnnotationRenderProps =
object
Defined in: packages/editor/src/renderers/renderer.types.ts:128
An annotation’s render function. Receives the annotation’s markDef
object and wraps the styled text it applies to. The engine anchors
the text in a <span> outside this render regardless of whether a
render is registered; this render’s job is the styling wrapper only.
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) => <MyAnnotation {...props} />.
Properties
Section titled “Properties”annotation
Section titled “annotation”annotation:
PortableTextObject
Defined in: packages/editor/src/renderers/renderer.types.ts:135
The annotation’s markDef object: {_key, _type, ...fields}.
Named annotation, not node, because path addresses the span
leaf carrying the annotation; the markDef itself lives in the block’s
markDefs array.
children
Section titled “children”children:
ReactElement
Defined in: packages/editor/src/renderers/renderer.types.ts:136
focused
Section titled “focused”focused:
boolean
Defined in: packages/editor/src/renderers/renderer.types.ts:137
path:
Path
Defined in: packages/editor/src/renderers/renderer.types.ts:138
readOnly
Section titled “readOnly”readOnly:
boolean
Defined in: packages/editor/src/renderers/renderer.types.ts:139
renderDefault()
Section titled “renderDefault()”renderDefault: (
props) =>ReactElement
Defined in: packages/editor/src/renderers/renderer.types.ts:146
Render this position with the engine’s default wrapper. See ContainerRenderProps.renderDefault. The default is identity: the engine applies no annotation markup of its own.
Parameters
Section titled “Parameters”AnnotationRenderProps
Returns
Section titled “Returns”ReactElement
selected
Section titled “selected”selected:
boolean
Defined in: packages/editor/src/renderers/renderer.types.ts:140