initialValue will overwrite newer set value
See original GitHub issueThe content of the Editor is loaded asynchronously, but I wanted to render the Editor itself already, because it takes quite some time. Problem is, that when changing the “value” attribute between the initial mounting and the final init of the editor, it will be overwritten by the “init” callback:
in src/components/Editor.tsx:
editor.on('init', () => {
this.initEditor(editor, initialValue);
});
I think the solution would be to guess the initialValue in the “initEditor” function instead of giving it here as an parameter.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Overwrite initial value from redux-form - reactjs - Stack Overflow
Before passing initialValues prop down to your redux-form component, you can modify it. Something like that:
Read more >Overwrite Initial Value on parameter form - Oracle Communities
When the parameter form is displayed, I have the initial value on my parameter form. I overwrite the p_month parameter with another value....
Read more >Initialize Signals and Discrete States - MATLAB & Simulink
Affects code generation only. For simulation, setting the initial value for S3 is irrelevant because the values are overwritten at model simulation start...
Read more >Editable keys - AppSheet Help - Google Support
In the AppSheet Editor, add the new key column, mark it as the Key, set its Initial Value to UNIQUEID() , and make...
Read more >Initial Value Templates - Sanity.io
If you want to clear the initial value defined for a nested type, you can do this by setting the initial value to...
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
I was not. I was using
value
. Async is the problem, it works like this:value=""
, that value is set inside theeditor.on('init',...)
eventvalue="initial"
and are set through thecomponentWillReceiveProps
functioninit
event is fired which overwrites the content with the older value from the initializationWorks like a charm, thanks.