Open imparvez opened 6 years ago
Have you solved it ? I have the very same situation here
For anyone who is still searching for the solution. Try the following:
setEditorValue( RichTextEditor.createValueFromString( response.data.organization.org_description, "html" )
While creating a dashboard in ReactJS, I used
react-rte
in few rich text editor based component. I am successfully sending the value in HTML format to my API with the help ofvalue.toString('html')
. Now once the value is saved from the dashboard and got updated in API too, if I again go to the same page, the text editor should be pre-filled with what is during an UPDATE operation. I want to know how I can achieve this, how can I pre-filled this rich text editor section while accessing saved data.onTextEditorChange = (value) => { this.setState({ value }); if (this.props.onTextEditorChange) { this.props.onTextEditorChange( value.toString('html') ); } };
<RichTextEditor value={this.state.value} onChange={this.onTextEditorChange} />