-
-
Notifications
You must be signed in to change notification settings - Fork 293
Using editor.addCommand in onMount the handler doesn't see actual value from state #427
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
Comments
I'm having the same problem. |
Now, i solved this problem with timestamp and useEffect i did a few steps
if you need pass some params to update value, you could put in useState with timestamp object (i did { timestamp, event }) But im sorry if this solution not is good. But at the same time i have no more ideas |
What's even stranger is if you say |
Looking at the source it seems there's an overuse of React memo calls. I published a version of this package that removes the offending calls https://www.npmjs.com/package/monaco-react-editor |
Uh oh!
There was an error while loading. Please reload this page.
Hello! Many thanks for this project!
I have a component which has a state. in onMount i passed a callback with two params (editor, monaco).
Then in onMount i can set editor.addCommand
ok
myFunc see always first value of Bool as false, and if the component will be updated, the trigger command will be use old not updated value of Bool
What incorrect i do? How should i use addCommand Correctly?
The text was updated successfully, but these errors were encountered: