Closed ItsMeViipeR closed 11 months ago
You should be able to use the controlled form data (https://github.com/vantezzen/auto-form#controlled-form) to clean and modify fields
But that doesn’t explain how to delete the input content.
You should be able to do something like:
const formSchema = z.object({
username: z.string()
});
const [values, setValues] = useState<Partial<z.infer<typeof formSchema>>>({});
<AutoForm values={values} onValuesChange={setValues}
onSubmit={() => {
setValues({
username: "",
});
}}
/>;
How to clear the input after submiting the stuff?