Replies: 1 comment 2 replies
-
RHF supports async |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using RHF in React Native Expo. Currently, there's a screen where I want to load initial values using RHF's defaultValues, and then check if these values were modified with isDirty (haven't gotten that far because I'm still having trouble implemented defaultValues wiht async). However, until now I've been using a workaround by using useEffect and setValue() after getting data from the backend.
I'd like to use RHF's features as much as possible. I imagine that if defaultValues was loaded correctly, I wouldn't have to rely on useEffect and thus not have to wrap onGetPhones in a useCallback... but I can't get it to work.
How should I set up defaultValues properly?
This is my code so far:
And this is the code for the ProfileInputRHF:
Beta Was this translation helpful? Give feedback.
All reactions