Replies: 1 comment
-
Hi 👋 Please see this fantastic article discussing the different approaches: https://tkdodo.eu/blog/react-query-data-transformations |
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.
-
Hi. Lets suppose we have useQuery thats gets user data from api. User has some number of array fields. I want to pick fields from user data and use them in different components. However doing something like that everywhere seems to be wrong
What i want to do is to create class named
UserModel
which has memoized methoduserModel.getSomeUserData
and insidequeryFn
return new UserModel(responseResult)
Is that approach correct ? Maybe there are alternatives to avoid code duplication ?
Beta Was this translation helpful? Give feedback.
All reactions