Skip to content

Accessing history object of plate editor #2419

Closed Answered by 12joan
JesseLiii asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, Slate cannot currently be used as a controlled component, so you'll have to code imperatively if you want to control it from the outside. There are various patterns you can use to do this, which have been discussed in serveral different Discussions (although I can't remember which ones).

My advice would be to use a reducer in your top-level component and pass down a dispatch function using context that Plate editors can use to register and deregister themselves on mount/unmount.

Replies: 1 comment 5 replies

Comment options

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

@12joan
Comment options

@JesseLiii
Comment options

@12joan
Comment options

Answer selected by zbeyens
@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