mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-02-04 01:32:54 +08:00
update export
This commit is contained in:
parent
df77fa39d9
commit
ed466f7b46
@ -35,7 +35,7 @@ export const defaultValue = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const JsonEditor: React.FC = () => {
|
export const JsonEditor: React.FC = () => {
|
||||||
const [json, setJson] = useLocalStorage("json", JSON.stringify(defaultValue));
|
const [json, setJson] = useLocalStorage("json", JSON.stringify(defaultValue));
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
@ -55,7 +55,7 @@ const JsonEditor: React.FC = () => {
|
|||||||
JSON.parse(value.json);
|
JSON.parse(value.json);
|
||||||
setJson(value.json);
|
setJson(value.json);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Invalid JSON!");
|
console.error("Invalid JSON!", error.stack);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
@ -63,5 +63,3 @@ const JsonEditor: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default JsonEditor;
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user