Skip to content

Commit bccec47

Browse files
committed
fix: Fix ref issue. #6
1 parent 755ce91 commit bccec47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const ReactCodeMirror = React.forwardRef<ReactCodeMirrorRef, ReactCodeMirrorProp
112112
onUpdate,
113113
extensions,
114114
});
115-
useImperativeHandle(ref, () => ({ editor: container, state, view }));
115+
useImperativeHandle(ref, () => ({ editor: container, state, view }), [container, state, view]);
116116
useEffect(() => {
117117
setContainer(editor.current);
118118
return () => {

0 commit comments

Comments
 (0)