mirror of
https://github.com/LukeHagar/form.git
synced 2025-12-07 12:27:45 +00:00
fix: cannot update a component/bad setState (#420)
* fix: cannot update a component/bad setState * fix: add dep useEffect in useForm * fix: add missing deps in useForm
This commit is contained in:
@@ -75,7 +75,10 @@ export function useForm<TData>(opts?: FormOptions<TData>): FormApi<TData> {
|
|||||||
})
|
})
|
||||||
|
|
||||||
formApi.useStore((state) => state.isSubmitting)
|
formApi.useStore((state) => state.isSubmitting)
|
||||||
formApi.update(opts)
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
formApi.update(opts)
|
||||||
|
}, [formApi, opts])
|
||||||
|
|
||||||
return formApi as any
|
return formApi as any
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user