Skip to main content

@lexical/react/LexicalCollaborationPlugin

Functions

CollaborationPlugin()

CollaborationPlugin(__namedParameters): Element

Defined in: packages/lexical-react/src/LexicalCollaborationPlugin.tsx:67

Connects the editor to a Yjs document for real-time collaboration, syncing editor state and rendering remote users' cursors and selections. Provide a providerFactory that creates the Yjs Provider for the given document id. Must be used within a LexicalCollaboration provider.

Parameters

__namedParameters

CollaborationPluginProps

Returns

Element

The element that renders collaborators' cursors (or an empty fragment until the provider and binding are initialized).


CollaborationPluginV2__EXPERIMENTAL()

CollaborationPluginV2__EXPERIMENTAL(__namedParameters): Element

Defined in: packages/lexical-react/src/LexicalCollaborationPlugin.tsx:247

Experimental

A variant of CollaborationPlugin that takes an already-created Yjs doc and Provider directly instead of a provider factory, giving the application full control over their lifecycle. Must be used within a LexicalCollaboration provider.

The API may change in a future release.

Parameters

__namedParameters

CollaborationPluginV2Props

Returns

Element

The element that renders collaborators' cursors.