New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃И POC: support async defaultValues #9052
Conversation
聽 Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +89 B (0%) Total Size: 18.1 kB
|
Will |
This will be really useful, is it going to be available soon by any chance? |
should work, will attach unit test coverage for use case as such. |
on the project board, will get to it eventually. no ETA at the moment. |
I am wondering how this would work when using something more declarative like react-query or swr? In those cases the data would be provided more like this where data would be undefined until the async operation completes. const { data } = useData(); useForm({ |
won't work, will need to use reset at useEffect |
RFC: #9046
Proposal Syntax
The following syntax will support async
defaultValues
, so we will manage thereset
form internally and updateisLoading
formState
accordingly.