Skip to content

Commit f3a2508

Browse files
committed
Fix bug with editor.value
PR: #225
1 parent b525b7d commit f3a2508

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/JoditEditor.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const JoditEditor = forwardRef(
4040

4141
useEffect(() => {
4242
const element = textArea.current;
43-
element.value = value || '';
4443
const jodit = Jodit.make(element, config);
4544
textArea.current = jodit;
4645

@@ -118,7 +117,7 @@ const JoditEditor = forwardRef(
118117

119118
return (
120119
<div className={'jodit-react-container'}>
121-
<textarea name={name} id={id} ref={textArea} />
120+
<textarea defaultValue={value} name={name} id={id} ref={textArea} />
122121
</div>
123122
);
124123
}

0 commit comments

Comments
 (0)