Skip to main content

Module: @lexical/react/useLexicalSubscription

References

default

Renames and re-exports useLexicalSubscription

Type Aliases

LexicalSubscription

Ƭ LexicalSubscription<T>: Object

Type parameters

Name
T

Type declaration

NameType
initialValueFn() => T
subscribe(callback: (value: T) => void) => () => void

Defined in

packages/lexical-react/src/useLexicalSubscription.tsx:15

Functions

useLexicalSubscription

useLexicalSubscription<T>(subscription): T

Shortcut to Lexical subscriptions when values are used for render.

Type parameters

Name
T

Parameters

NameType
subscription(editor: LexicalEditor) => LexicalSubscription<T>

Returns

T

Defined in

packages/lexical-react/src/useLexicalSubscription.tsx:23