Skip to content

StateFieldSpec.toJSON method

StateFieldSpec › toJSON

A function used to serialize this field's content to JSON. Only necessary when this field is included in the argument to EditorState.toJSON.

Signature:

toJSON(value: Value, state: EditorState): unknown

Parameters:

ParameterTypeDescription
valueValueThe value to serialize.
stateEditorStateThe state to serialize the value for.

Returns: unknownThe serialized value.