mirror of
https://github.com/LukeHagar/form.git
synced 2025-12-07 20:37:48 +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)
|
||||
|
||||
React.useEffect(() => {
|
||||
formApi.update(opts)
|
||||
}, [formApi, opts])
|
||||
|
||||
return formApi as any
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user