Skip to content

Commit 9f95158

Browse files
committed
fix: fix value props issue. (#210)
1 parent 56b09de commit 9f95158

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ function MarkdownEditorInternal(
130130
};
131131
const height = typeof codemirrorProps.height === 'number' ? `${codemirrorProps.height}px` : codemirrorProps.height;
132132

133+
const preValue = props.value;
134+
useEffect(() => setValue(preValue ?? ''), [preValue]);
135+
133136
const previewScrollHandle = useCallback(
134137
(event: Event) => {
135138
if (!enableScroll) return;

0 commit comments

Comments
 (0)