Joeri Exelmans 2 년 전
부모
커밋
515ecaf27a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/frontend/use_const.ts

+ 1 - 1
src/frontend/use_const.ts

@@ -5,7 +5,7 @@ export function useConst<T>(initialCb: ()=>T): T {
   const ref = React.useRef<T>();
   if (ref.current === undefined) {
     const initialValue = initialCb();
-    ref.current = initialCb();
+    ref.current = initialValue;
   }
   return ref.current!;
 }