mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-12 19:02:53 +08:00
remove unnecessary useEffect
This commit is contained in:
parent
f573565348
commit
199c01a377
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user