Replies: 1 comment
-
doing a form submit after you've fetched these would then likely need to be done in an effect:
not really sure if that is better. the advantage would be that you get caching, which you don't really get with the refetch method, because it would just refetch every time you click submit, even if you have fresh data in the cache. At that point, your version is not really different than calling |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've to use 3 API's data to submit a form. I should fill 3 drop-downs by fetching these APIs
I was thinking to implement something like this:
But I've doubt on this scenario which is best practice or not? Is there any way to write this code simpler and clean?
Actually, I couldn't use
https://react-query.tanstack.com/guides/dependent-queries
because these queries work separately and aren't in a nested list of API calls.Beta Was this translation helpful? Give feedback.
All reactions