Skip to content

EditorState.replaceSelection method

EditorState › replaceSelection

Official

Create a transaction spec that replaces every selection range with the given content.

Signature:

replaceSelection(text: string | Text): TransactionSpec

Parameters:

ParameterTypeDescription
textstring | TextThe replacement text.

Returns: TransactionSpecThe transaction spec.