Skip to main content

@lexical/react/useLexicalIsTextContentEmpty

Functions​

useLexicalIsTextContentEmpty()​

useLexicalIsTextContentEmpty(editor, trim?): boolean

Defined in: packages/lexical-react/src/useLexicalIsTextContentEmpty.ts:23

Tracks whether the editor's text content is empty, updating as the editor changes. Pass trim to ignore leading and trailing whitespace when deciding emptiness.

Parameters​

editor​

LexicalEditor

trim?​

boolean

Returns​

boolean

true while the editor's text content is empty.