Closed anuraggautam77 closed 6 years ago
You can check for editor instanceReady event like this -
<CKEditor
events={{
"instanceReady": this.onInstanceReady
}}
/>
And then you can set content or do any other action in your onInstanceReady function.
So still it's showing me blank.
<CKEditor ref='editor' activeClass="p10" config={{language: 'en', toolbarCanCollapse: false}}
content={this.state.content} placeholder="Trying ..." events={
{
"blur": this.onBlur,
"afterPaste": this.afterPaste,
"change": this.onChange,
"instanceReady": this.onInstanceReady
}}
/>
onInstanceReady(){
this.setState({
content: data[0].bodyContent
});
}
It works for me inside the instanceReady function.
evnt.editor.setData(json.posts[0].body);
I want setState to content but it shows me empty content in an editor after it gets loaded. This is due to delay in initialize the editor. How we can overcome this delay.