Skip to content

Commit a64b555

Browse files
committed
상태관리 리렌더링 최적화
1 parent f5c830d commit a64b555

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

  • src/pages/Visualization/components/LeftSection/components

src/pages/Visualization/components/LeftSection/components/CodeEditor.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@ const CodeEditor = ({ onboardingStep, setTutorialPosition }: props) => {
2727
const stepIdx = useConsoleStore((state) => state.stepIdx);
2828
const errorLine = useEditorStore((state) => state.errorLine);
2929
const resetErrorLine = useEditorStore((state) => state.resetErrorLine);
30-
const { setFocus } = useEditorStore();
30+
const setFocus = useEditorStore((state) => state.setFocus);
3131
const setIsGptToggle = useGptTooltipStore((state) => state.setIsGptToggle);
32-
const { setGptTop, setGptLeft } = useGptTooltipStore();
33-
const { setTimeoutId, clearCurrentTimeout } = useTimeoutStore();
34-
const { gptPin, setGptPin } = useGptTooltipStore();
35-
const { resetTrigger } = useResetEditor();
32+
const setGptTop = useGptTooltipStore((state) => state.setGptTop);
33+
const setGptLeft = useGptTooltipStore((state) => state.setGptLeft);
34+
const setTimeoutId = useTimeoutStore((state) => state.setTimeoutId);
35+
const clearCurrentTimeout = useTimeoutStore((state) => state.clearCurrentTimeout);
36+
const gptPin = useGptTooltipStore((state) => state.gptPin);
37+
const setGptPin = useGptTooltipStore((state) => state.setGptPin);
38+
const resetTrigger = useResetEditor((state) => state.resetTrigger);
3639
const timeoutRef = useRef<number | null>(null);
3740
const codeEditorRef = useRef<HTMLDivElement | null>(null);
3841
const calculatePosition = () => {

0 commit comments

Comments
 (0)