|
@@ -149,7 +149,6 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
|
|
|
// set to ref
|
|
// set to ref
|
|
|
initialValueRef.current = initialValue;
|
|
initialValueRef.current = initialValue;
|
|
|
}, [initialValue]);
|
|
}, [initialValue]);
|
|
|
-
|
|
|
|
|
const [markdownToPreview, setMarkdownToPreview] = useState<string>(initialValue);
|
|
const [markdownToPreview, setMarkdownToPreview] = useState<string>(initialValue);
|
|
|
const setMarkdownPreviewWithDebounce = useMemo(() => debounce(100, throttle(150, (value: string) => {
|
|
const setMarkdownPreviewWithDebounce = useMemo(() => debounce(100, throttle(150, (value: string) => {
|
|
|
setMarkdownToPreview(value);
|
|
setMarkdownToPreview(value);
|
|
@@ -159,6 +158,7 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
|
|
|
setMarkdownPreviewWithDebounce(value);
|
|
setMarkdownPreviewWithDebounce(value);
|
|
|
}, [setMarkdownPreviewWithDebounce]);
|
|
}, [setMarkdownPreviewWithDebounce]);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
const { data: codeMirrorEditor } = useCodeMirrorEditorIsolated(GlobalCodeMirrorEditorKey.MAIN);
|
|
const { data: codeMirrorEditor } = useCodeMirrorEditorIsolated(GlobalCodeMirrorEditorKey.MAIN);
|
|
|
|
|
|
|
|
const { scrollEditorHandler, scrollPreviewHandler } = useScrollSync(GlobalCodeMirrorEditorKey.MAIN, previewRef);
|
|
const { scrollEditorHandler, scrollPreviewHandler } = useScrollSync(GlobalCodeMirrorEditorKey.MAIN, previewRef);
|