瀏覽代碼

add missing dependency values

Aykut Saraç 3 年之前
父節點
當前提交
c0e5e4e190
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/containers/JsonEditor/index.tsx

+ 2 - 2
src/containers/JsonEditor/index.tsx

@@ -91,7 +91,7 @@ const JsonEditor: React.FC<{
     }
 
     setValue(json);
-  }, [json]);
+  }, [config.autoformat, json]);
 
   React.useEffect(() => {
     const formatTimer = setTimeout(() => {
@@ -107,7 +107,7 @@ const JsonEditor: React.FC<{
     }, 1000);
 
     return () => clearTimeout(formatTimer);
-  }, [value, config.autoformat]);
+  }, [value, config.autoformat, setJson]);
 
   return (
     <StyledEditorWrapper>