diff --git a/src/App.tsx b/src/App.tsx index 58a1bec..0c81662 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -19,10 +19,10 @@ const FormValues = schema.fields.reduce((acc, currValue) => { export type TFormValues = typeof FormValues; function App() { - const [value, setValue] = useState(`${JSON.stringify(schema, null, 2)}`); - const onChange = useCallback((val, viewUpdate) => { - console.log("val:", val); - setValue(val); + const [value, setValue] = useState(schema); + const onChange = useCallback((val) => { + const tempSchema = SchemaDef.parse(JSON.parse(val)); + setValue(tempSchema); }, []); const { @@ -43,7 +43,7 @@ function App() {