remove unnecessary useEffect

This commit is contained in:
AykutSarac 2022-04-24 23:39:30 +03:00
parent f573565348
commit 199c01a377

View File

@ -58,14 +58,6 @@ const JsonEditor: React.FC = () => {
};
}, [json]);
React.useEffect(() => {
if (settings.autoformat) {
return setValue(JSON.stringify(JSON.parse(json), null, 2));
}
setValue(json);
}, [settings.autoformat, json]);
React.useEffect(() => {
const formatTimer = setTimeout(() => {
try {
@ -86,7 +78,7 @@ const JsonEditor: React.FC = () => {
}, 1800);
return () => clearTimeout(formatTimer);
}, [value, settings.autoformat, dispatch]);
}, [value, settings.autoformat, dispatch, json]);
return (
<StyledEditorWrapper>