Skip to content

Commit 5146be2

Browse files
committed
fix: fix enablePreview props issue. (#205)
1 parent 3810340 commit 5146be2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/src/commands/preview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { IMarkdownEditor, ToolBarProps } from '..';
44

55
const Preview: React.FC<{ command: ICommand; editorProps: IMarkdownEditor & ToolBarProps }> = (props) => {
66
const { editorProps } = props;
7-
const { containerEditor, preview, previewWidth = '50%', enablePreview } = editorProps;
7+
const { containerEditor, preview, previewWidth = '50%', enablePreview = true } = editorProps;
88
const [visible, setVisible] = useState(props.editorProps.visible);
99
useEffect(() => setVisible(props.editorProps.visible), [props.editorProps.visible]);
1010
useEffect(() => {
@@ -34,7 +34,6 @@ const Preview: React.FC<{ command: ICommand; editorProps: IMarkdownEditor & Tool
3434
}
3535
}
3636
}, [visible, containerEditor, preview, previewWidth]);
37-
3837
if (!enablePreview) return;
3938

4039
return (

0 commit comments

Comments
 (0)