Skip to content

useEditorRef with id from inside a plugin component returns active editor (not id) #3042

Answered by zbeyens
bennyqp asked this question in Q&A
Discussion options

You must be logged in to vote

This works like React context: it needs to be above the component. That should work:

<Plate id="editor1">
        <Plate id="editor2" initialValue={initialValue} plugins={plugins}>
          <div className="w-full">
            <h1>Editor 1</h1>
            <PlateContent className="editor" placeholder="This is editor1" />
          </div>
            <div className="w-full">
              <h1>Editor 2</h1>
              <PlateContent className="editor" />
            </div>
          </div>
        </Plate>
      </Plate>

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@zbeyens
Comment options

Answer selected by bennyqp
@bennyqp
Comment options

@12joan
Comment options

@zbeyens
Comment options

@zbeyens
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants