Closed amolpatel closed 2 years ago
@amolpatel do you have any issue with editor reloading on state change ?
@dukesx nope, I don't think so
@amolpatel strangely , whenever i enter a value inside the editor, the damn thing just resets itself, like the state, its like the state change triggers it to reset for some reason
Happening to me as well. @amolpatel what was the fix?
@nickscamara You just need to re-render the textarea
:
<MDEditor
value={value}
onChange={(text) => onChange(text ?? "")}
components={{
textarea: (props) => {
return (
// @ts-ignore
<textarea {...props} />
);
},
}}
/>
@amolpatel Thank you very much. That and upgrading to the latest version fixed.
For some reason, the editor is wrapped in a pre and I can't find anywhere to disable that in the props. I'm using NextJS and tailwind. I followed the instructions on how to install using Next. Any help would be appreciated!
Rendered HTML:
React code: