Is createApi really better ? #3729
Ronnin1994
started this conversation in
General
Replies: 1 comment 5 replies
-
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello !
I have two questions:
When I get data from my Api using the method created by createApi, it renders my application 3 times in a row. Is it not inneficient to trigger so many render ?
const { data, isLoading, isError, error } = useGetDataQuery();
When we mutate our datas, we have to invalidate our previous query to get the new datas. It does make us do more request to our Api, when with the old way, we would have done our PUT request to update our datas and change it ourself in our local store. We would have done a new request only if we refresh our application. Making more request means increasing the cost of our application. Do I miss something ?
Thank you for your time (hoping my english is understandable)
Beta Was this translation helpful? Give feedback.
All reactions