diff --git a/src/containers/JsonEditor/index.tsx b/src/containers/JsonEditor/index.tsx index 7a75925..5135726 100644 --- a/src/containers/JsonEditor/index.tsx +++ b/src/containers/JsonEditor/index.tsx @@ -55,6 +55,11 @@ export const defaultValue = [ export const JsonEditor: React.FC = () => { const [json, setJson] = useLocalStorage("json", JSON.stringify(defaultValue)); + const [initialJson, setInitialJson] = React.useState(json); + + React.useEffect(() => { + setInitialJson(json); + }, []); React.useEffect(() => { const element = document.querySelector( @@ -71,7 +76,7 @@ export const JsonEditor: React.FC = () => { return (