-
-
Notifications
You must be signed in to change notification settings - Fork 165
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When starting a lexical new document, initialEditorState always been populated with a empty document, then we cant add a boilerplate on initialEditorState
Steps to reproduce the bug
Steps to reproduce the behavior:
- Any template from Lexical with Collaboration pluggin code
Expected behavior
When new page/document is created, on HocuspocusWebsocketProvider or wiht HocuspocusProvider
Environment?
- operating system: win64
- browser: edge-chromium
- mobile/desktop: desktop
- Hocuspocus version: 3.1.0
Additional context
<CollaborationPlugin
id={id}
providerFactory={providerFactory}
// Optional initial editor state in case collaborative Y.Doc won't
// have any existing data on server. Then it'll use this value to populate editor.
// It accepts same type of values as LexicalfgfComposer editorState
// prop (json string, state object, or a function)
initialEditorState={(editor) => {
console.log("3ditor", editor)
}}
shouldBootstrap={true}
cursorsContainerRef={cursorsContainerRef}
username={provider?.awareness?.getLocalState()?.name}
cursorColor={provider?.awareness?.getLocalState()?.color}
/>
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working