Nice video, thank you! Just want to point out that they reason why even with 3G throttling the Next button didn't get disabled is because you put "&&" instead of "||". Since data.info.next for all but one (the last page) is not null, !data.info.next would evaluate to false, which means disabled is also false. Timestamp: 36:30 Otherwise, great job!
another way i got to see the effect of this was to remove it from display when true. with the 3G throttling it was wholesome😉 {!isPreviousData && ( setPage((prev) => prev + 1)} > Next )}
Thanks, If I hadn't seen this today, then I'd be implementing my own React Query to cache paginated responses in the next few days. Saved me a lot of work.
Laith you are absolutely the best teacher ever! I learned so much from you and still keep learning every day. Thank you so much for your time and effort. Can't wait to see more React stuff on your channel!
Do you use another state manager with it, as I heard it's not supposed to be a replacement for something like Redux but specialize in asynchronous api calls, thanks.
Thank you so much for creating this tutorial. It helped me a lot in case of better understanding of React Query. Thanks once again. Looking forward for more!
great tutorial, covering critical parts like query strings and pagination, thank you. I have a question, I couldnt fully understand the purpose of isPreviousData. Is it just for user to not let press previous button before the data is fetched ? to prevent our actual data to be messed up?
By saying that we want to keep the previousData until we fetch the new ones, we have to first check if we are in the previous data state (because requests take time). If that is the case, we want to disable the next button because we don't want them to press it again in the middle of a fetch. Therefore we use the isPreviousData property to check this
@@laithacademy sir gith hub actions and ci cd crash course if possible sir , really thanks for your tutorials it helps alot for starting up with new technologies
Was struggling to get the request working, status always went from loading to error. Reading the Github of react-query, I found out useQuery requires an array as first argument and not a string. Maybe it changed along the way... I'm using v4.0.0.
Hi , a little doubt, when I use react query (useQuery) with the same id, in different components, every time the component is mounted it re-fetches the data without using the cache. Do you know what the problem is if you want to get the same data in different components without calling the server again? Greetings.
Why does, with the introduction of every 'new' or 'on trend' library/code style etc, every tutorial video like this come with the 'it was a bit of a hassle doing it this way' speech when it made it 10x better than what we had before that. So weird.
Nice video, thank you! Just want to point out that they reason why even with 3G throttling the Next button didn't get disabled is because you put "&&" instead of "||". Since data.info.next for all but one (the last page) is not null, !data.info.next would evaluate to false, which means disabled is also false.
Timestamp: 36:30
Otherwise, great job!
another way i got to see the effect of this was to remove it from display when true. with the 3G throttling it was wholesome😉
{!isPreviousData && (
setPage((prev) => prev + 1)}
>
Next
)}
@@joshuaebhoria8046 sorry, what does the ?. mean in your code
Ah so if not null then you will access its prop, right?
@@atvonguyentien5726 It's used to check undefined
Thank you Laith, you literally saved my life!
First time got o/p in RUclips react videos tq u so much
Thanks, If I hadn't seen this today, then I'd be implementing my own React Query to cache paginated responses in the next few days.
Saved me a lot of work.
Laith you are absolutely the best teacher ever! I learned so much from you and still keep learning every day. Thank you so much for your time and effort. Can't wait to see more React stuff on your channel!
😎Ohhh.... what a easy way of delivering complex thing. 🤩😇
laith upload i liek!! man, your teaching helped me so much these last month. i hope you will reach millions subs!!
This library has single-handedly made my developer experience so much better. Happy to see you covering react-query on your channel.
Do you use another state manager with it, as I heard it's not supposed to be a replacement for something like Redux but specialize in asynchronous api calls, thanks.
@@lardosian React Query is for server state, for UI state you can use Context, Redux etc...
@@ckh8217 Yes that's what I was getting at, so an app would need 2 providers then.
Wanna know how to use react query with redux-toolkit
@@bishnudas3562 By using the inbuilt RTK Query
Holy moly, straight to the detail and explained clearly and very concise. Thank you.
wow black on a very dark gray bg is the 2022 trends I guess
Awesome, thanks for the tutorial.
Hoping for a 2nd part covering mutations!
Also looking forward to the 2th part.
best react query lesson at all , very clear
Thank you so much for creating this tutorial. It helped me a lot in case of better understanding of React Query.
Thanks once again. Looking forward for more!
Best Tutorial on React Query that covered critical techniques. Thank you sir
I actually had to speed down to 0.25 to notice the loading state which was very weird.
Very good video well done.
Thank you for this upload. It helped me to use react-query .
I didn't know this API existed! Pretty excited to integrate this into discord!
Wow react query sure is a lot easier then implementing my own caching system lol. Thanks for the tutorial!
great tutorial, covering critical parts like query strings and pagination, thank you.
I have a question, I couldnt fully understand the purpose of isPreviousData.
Is it just for user to not let press previous button before the data is fetched ? to prevent our actual data to be messed up?
By saying that we want to keep the previousData until we fetch the new ones, we have to first check if we are in the previous data state (because requests take time). If that is the case, we want to disable the next button because we don't want them to press it again in the middle of a fetch. Therefore we use the isPreviousData property to check this
@@laithacademy sir gith hub actions and ci cd crash course if possible sir , really thanks for your tutorials it helps alot for starting up with new technologies
고맙습니다. 항상 큰 도움이 되고있어요!
Amazing learnt so much
Love your content👍👍👍
Really Amazing 🔥
It's easier than it looks. I found learning soft design (like setups - I use SERUM) much more scary but it's doable, you just gotta be
Very nice and concise
I can never quite get auto import to work as well as I see in these excellent videos 😅
Amazing video and use || instead of && in last duration of the video in button
@10:19 you say that's a common issue, could you explain how to fix that issue?
Was struggling to get the request working, status always went from loading to error.
Reading the Github of react-query, I found out useQuery requires an array as first argument and not a string. Maybe it changed along the way... I'm using v4.0.0.
Clicked the video taught it was from traversy media 😅. But still great content overall
Awesome +++++++++++ 😀
From where you edit your videos
it"s Help full Thanks
For the fetching without React/Tanstack Query why not add a try/catch with loading/error state? This would really show how much work this is.
This
Awesome video ++++++ 😃
Hi , a little doubt, when I use react query (useQuery) with the same id, in different components, every time the component is mounted it re-fetches the data without using the cache. Do you know what the problem is if you want to get the same data in different components without calling the server again?
Greetings.
You should make playlists.
Awesome !
Hey laith thanks for the videos, Please make a video on SWR
Thank you!
Now you have to do SWR so next.js people don't feel left out,,, LOL
nicely explained
good keep uploading
good
Why does, with the introduction of every 'new' or 'on trend' library/code style etc, every tutorial video like this come with the 'it was a bit of a hassle doing it this way' speech when it made it 10x better than what we had before that. So weird.
Forgot important feature. Which is using cached data from another component!
What was that nifty .container shortcut you did at 22:50?
just found it is emmet!! so glad to have found this
Where is Angular part 2 and 3 ???
Sir, i learned React Js.. now will i switch to Remix js or Next js?
40 40 tooth bruh.
lol, 40 tooth page
{2022-11-15}, {2022-11-22}
Already out of date