Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usePlateEditor value dependency trigger #3891

Open
TrySpace opened this issue Dec 20, 2024 · 0 comments
Open

usePlateEditor value dependency trigger #3891

TrySpace opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@TrySpace
Copy link

Description

This might be by design, but I assumed that the usePlateEditor state would be updated when the value changes, but I have to manually pass it to the optional deps array like so:

const editor = usePlateEditor(
    {
      value,
      plugins,      
    },
    [value]
  )

In order for it to be updated.

Reproduction URL

No response

Reproduction steps

The following code won't update the `<Plate readOnly />` editor when the value has changed. This is not necessarily intuitive.


const editor = usePlateEditor(
    {
      value,
      plugins,      
    }
  )

Plate version

40.3.4

Slate React version

0.112.0

Screenshots

No response

Logs

No response

Browsers

Chrome

@TrySpace TrySpace added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant