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:

Parameter Type Description
text string | Text The replacement text.

Returns: TransactionSpecThe transaction spec.