How do I create a controlled Editor? #239
Unanswered
rasmus-hvid
asked this question in
Q&A
Replies: 1 comment
|
It's not a usual React component, the monaco has its own internal state that is being maintained by itself, and we try not to interact/prevent that logic as much as it is possible. We just get/set the value, but we won't prevent the typing. Plus it would be hard to achieve and not recommended. However, you can try something like this |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Given the following
... I would intuitively expect that I would not be able to update the contents of the editor, since I do not update the value of
code. But as it can be seen here I can in fact change the contents of the editor without changing the value ofcode.Therefore my question, how do I make a controlled editor? I can see that older versions had a ControlledEditor component, but as far as I can tell this is not the case anymore.
All reactions