Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
JOOHOJANG committed Nov 5, 2024
1 parent 97298e9 commit 1c6b6d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/src/components/editor/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Preview = () => {
const editorStore = useSelector(selectEditor);
const [content, setContent] = useState("");
const containerRef = useRef<HTMLDivElement>(null);
const throttledUpdatePreviewConetent = useMemo(
const throttledUpdatePreviewContent = useMemo(
() =>
_.throttle(
() => {
Expand All @@ -71,17 +71,17 @@ const Preview = () => {
useEffect(() => {
if (!editorStore.doc) return;

throttledUpdatePreviewConetent();
throttledUpdatePreviewContent();

const unsubscribe = editorStore.doc.subscribe("$.content", () => {
throttledUpdatePreviewConetent();
throttledUpdatePreviewContent();
});

return () => {
unsubscribe();
setContent("");
};
}, [editorStore.doc, throttledUpdatePreviewConetent]);
}, [editorStore.doc, throttledUpdatePreviewContent]);

useEffect(() => {
if (containerRef.current == null) {
Expand Down

0 comments on commit 1c6b6d7

Please sign in to comment.