Can't call `setValue` on Editor React component
See original GitHub issueDo you want to request a feature or report a bug?
BUG
What’s the current behavior?
Editor
react component instance is missing the setValue
method.
In plugin event handler, I can’t call editor.setValue
as it’s undefined
.
What’s the expected behavior?
Editor
react component instance has the setValue
method.
It should be possible to call editor.setValue
from plugin event handler.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
setValue is not defined in react for react hooks - Stack Overflow
your updateAPI function cant find setValue useState hook because they are not in the same scope. import React, {useState} from "react"; ...
Read more >useForm - setValue - React Hook Form
This function allows you to dynamically set the value of a registered field and have the options to validate and update the form...
Read more >Updating Objects in State - React Docs
State can hold any kind of JavaScript value, including objects. But you shouldn't change objects that you hold in the React state directly....
Read more >Using localStorage with React Hooks - LogRocket Blog
This makes this Hook a perfect place to call the setItem method. Open the components/Form1.js file and add the following code above the ......
Read more >Input Components - React-admin - Marmelab
Input components require a source prop. import { Edit, SimpleForm, ReferenceInput, SelectInput, TextInput, required } from 'react-admin'; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, this is by design because
setValue
is an internal-type method for setting things up. Event handlers should not be callingeditor.setValue
and should instead be using operations to achieve this.Slate needs more docs on how to utilize the Editor in an uncontrolled way, without having to deal with handling 1000s of state transitions. I’m looking for something like
setValue
(andgetValue
?) as well since it’s mentioned in the docs, but when I try to access it from the Editorref
it’s undefined.