react-froala-wysiwyg
react-froala-wysiwyg copied to clipboard
Froala get code content without switching back to code view
Is there a way to get the content on change inside code editor rather than switching back to code view. Please help
I want to get the content inside the code editor while adding the html code.

You can read the content from onModelChange prop on the FroalaEditorComponent, by calling a function. I'll leave you an example below.
Example:
const readData = (content) => {
console.log(content)
}
return (
<FroalaEditorComponent onModelChange={readData}/>
)
@leny32 this seems to allow us to sync what is in the editor with our component state. How do we do the reverse, set an initial state for the code/markdown plug in?