Code Monkey home page Code Monkey logo

Comments (4)

ozanyurtsever avatar ozanyurtsever commented on May 23, 2024 2

Hello @damir-i , initialEditorState property of RichTextPlugin is deprecated with Lexical 0.5, see;
facebook/lexical@8cba075

Seems like, the functionality of initializing an editor state is moved to LexicalComposer;
https://lexical.dev/docs/concepts/editor-state#understanding-the-editor-state

<LexicalComposer initialConfig={{
  editorState: initialEditorState
}}>
  <LexicalRichTextPlugin />
  <LexicalOnChangePlugin onChange={editorState => editorStateRef.current = editorState} />
  <Button label="Save" onPress={() => {
    if (editorStateRef.current) {
      saveContent(JSON.stringify(editorStateRef.current))
    }
  }} />
</LexicalComposer>

We need to adapt verbum to this changes accordingly.

from verbum.

damir-i avatar damir-i commented on May 23, 2024

Thank you for your response, I will keep using the older version until this is adapted.

from verbum.

ozanyurtsever avatar ozanyurtsever commented on May 23, 2024

Thank you for your response, I will keep using the older version until this is adapted.

0.4.1 is now released with initialEditorState feature.

from verbum.

cdt-eth avatar cdt-eth commented on May 23, 2024

hey there @ozanyurtsever, i'm new to verbum/lexical. is initialEditorState how we would set an intial value in the editor?

my usecase: we have a form, onChange we save to our data, before submission a use can preview their submission (new page), but they can go back to change things, but the editor is blank. i'd like to paste back in that data we saved from their current work in progress.

so need to know how to set the ('.ContentEditable__root').innerHTML with an initial value, thanks!

from verbum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.