Skip to content

Commit

Permalink
Fix bug with editor.value
Browse files Browse the repository at this point in the history
PR: #225
  • Loading branch information
xdan committed Jun 30, 2023
1 parent b525b7d commit f3a2508
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/JoditEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const JoditEditor = forwardRef(

useEffect(() => {
const element = textArea.current;
element.value = value || '';
const jodit = Jodit.make(element, config);
textArea.current = jodit;

Expand Down Expand Up @@ -118,7 +117,7 @@ const JoditEditor = forwardRef(

return (
<div className={'jodit-react-container'}>
<textarea name={name} id={id} ref={textArea} />
<textarea defaultValue={value} name={name} id={id} ref={textArea} />
</div>
);
}
Expand Down

0 comments on commit f3a2508

Please sign in to comment.