React Query - Complete Tutorial

  Рет қаралды 154,356

Cosden Solutions

Cosden Solutions

Күн бұрын

Пікірлер: 198
@cosdensolutions
@cosdensolutions 9 ай бұрын
Hope you enjoyed the video! I also have a really cool and unique course that will teach you way more than this video. You'll learn how to build an actual complex project with React. It's called "Project React" and you can find it at cosden.solutions/project-react. Also, I have a free weekly newsletter called "Import React" with tutorials, news, and cool stuff about React! You can sign up at cosden.solutions/newsletter?s=ytc
@akashddeepchitransh4537
@akashddeepchitransh4537 10 ай бұрын
Before I found your channel I used to find the longest video to learn something, but now I search for your videos, it really saves my time alot.
@morchellemusic2829
@morchellemusic2829 Жыл бұрын
I wish all the tutorials were like this, straight to the point! Sometimes you gotta watch 1 hour for 20 minutes of information. Great work, just subscribed!
@cosdensolutions
@cosdensolutions Жыл бұрын
yeah, that's my goal!
@rameezh88
@rameezh88 Жыл бұрын
I've watched a couple of your videos. Always to the point and exactly the knowledge I need to understand, feel confident, and get started. Thank you!
@SuperYoda7
@SuperYoda7 10 ай бұрын
you explain it in such a clear and simple yet concise way that even I understand it perfectly. please do something on trpc if you haven't already.
@DiogoScarmagnani
@DiogoScarmagnani Ай бұрын
Great video! Another way you can refetch the data is just destructuring `refetch` prop from the return of `useQuery`, then you can invoke `refetch()` inside the `onSuccess` function of `useMutation`, making unnecessary to import `useQueryClient`.
@ammaraateeb1914
@ammaraateeb1914 Жыл бұрын
Concise, pointed and fundamental information. Done better than the rest. *subscribed* to support hard working creative individuals
@cosdensolutions
@cosdensolutions Жыл бұрын
means a lot, thanks! 🤙
@MagedMegz95
@MagedMegz95 7 ай бұрын
I recently discovered your channel, and I cannot state enough how much I like your approach. No BS, just straight to the point with the information that's both useful and practical. Love it!
@lateefmushtaq6059
@lateefmushtaq6059 2 ай бұрын
I have learnt 80% of the react /ts from your videos, but i find this video very informative in just 18 minutes making this video a bit complicated.
@gaganyt7861
@gaganyt7861 Жыл бұрын
This tutorial of react query is king of all tutorials in the youtube more concise and excellent explanation, i think even chatgpt cant explain this much concisely Subscribed and love to eatch evey video of yours
@cosdensolutions
@cosdensolutions Жыл бұрын
damn, thank you!
@fabryscript
@fabryscript Жыл бұрын
Thanks a lot for the informative video, straight to the point and without excessive clutter!
@SonuKumarTech
@SonuKumarTech Жыл бұрын
I am becoming a fan of your teaching style. First i watched your redux video and now i am not watching any other redux tutorial. because that video is so straightforward and to the point. please keep on adding videos like this. already subscribed:) 👍
@_tanzil_
@_tanzil_ Жыл бұрын
Nice and concise. No nonsense and unnecessary lingering. 👍 SUBSCRIBED
@chhavimanichoubey9437
@chhavimanichoubey9437 4 ай бұрын
you are simply amazing, subscribed, not to mention i want to highly emphasize on reading docs, they mention each feature properly, so if someone have issues, kindly check docs, it almost always helps.
@shahzaibkhan5423
@shahzaibkhan5423 3 ай бұрын
Amazing ! Everything about React Query in just one video. Thank you very much sir
@developer825
@developer825 8 ай бұрын
I like your comprehensive approach and clear explanations. Thank you for the tutorial.
@RonnieDenzel
@RonnieDenzel 11 ай бұрын
Thanks for another important react video,concise and straight to the point,already subscribed
@priyanshugupta4875
@priyanshugupta4875 2 ай бұрын
great video, cant believe you did it in 18 minutes
@Pareshbpatel
@Pareshbpatel 9 ай бұрын
React Query, so clearly explained. Thank you. {2024-04-14}, {2024-06-03}
@persas1683
@persas1683 7 ай бұрын
Thanks so much! Your tutorial is extremely clear and comprehensive.
@EpistemicFomo
@EpistemicFomo Жыл бұрын
Concise and simple explanation! Thank you!
@cosdensolutions
@cosdensolutions Жыл бұрын
Glad you enjoyed it! 🤙
@jimtaika2572
@jimtaika2572 Жыл бұрын
aaaaah my eyes!! Blinded for couple of seconds. Good content, subscribed
@cosdensolutions
@cosdensolutions Жыл бұрын
yeah will work on that, my bad!
@blaqhakym
@blaqhakym Жыл бұрын
😊 You got me when you said "over 30% of you are not subscribed". I quickly tapped the subscribe button immediately. Thanks for the amazing content bro
@cosdensolutions
@cosdensolutions Жыл бұрын
Hahaha thanks a lot! ☺️
@srikanthracharla420
@srikanthracharla420 Жыл бұрын
Subscribed, this is what I am looking for 🔥
@Ranjeetvishwakarma-72
@Ranjeetvishwakarma-72 4 ай бұрын
Amazing Exaplantion , Any beginer can understand these topic very well 🔆🔆
@serkan1804
@serkan1804 10 ай бұрын
Many thanks, I always find your videos really helpful.
@devvagnerBR
@devvagnerBR Жыл бұрын
the best video about react query that i found, thx for that 💚
@franklinmayoyo
@franklinmayoyo 9 ай бұрын
You guy! You have every piece of knowledge I need. ❤
@astro-diego
@astro-diego Жыл бұрын
Concise and helpful. Nice explanation about React query. Thanks a lot!
@d3215k
@d3215k 10 ай бұрын
Thanks. Your tutorial is very helpful. Hopefully there will be some regarding Tanstack routers too
@imamdroubi6537
@imamdroubi6537 Жыл бұрын
There are videos that you feel guilty if you didn't leave a comment on them thanking the creator , this is one of them Thanks a lot man
@cosdensolutions
@cosdensolutions Жыл бұрын
thank you for the kind words!
@floyd0987
@floyd0987 11 ай бұрын
You're just brilliant! I'd like to see a tutorial on Apollo Client... the way you explain code is extraordinary
@adeemmmm
@adeemmmm 5 ай бұрын
Thank you for having a tutorial for everything
@Mainak908
@Mainak908 Жыл бұрын
Awesome man❤❤...u r doing a good work...keep it up
@Di-yes
@Di-yes Жыл бұрын
Love this library. Really useful one for sure.
@johnacsyen
@johnacsyen 10 ай бұрын
Well explained. Thanks for the time to make this tutorial.
@MrTouqeerhameed
@MrTouqeerhameed 9 ай бұрын
Nice and short with full of information ✌
@Shaheer-xs5os
@Shaheer-xs5os Жыл бұрын
Highly valuable! thank you for this video!
@syedismail4896
@syedismail4896 3 ай бұрын
12:14 when query is invalidated, it marks as stale but it doesn't immediately refetch them, it relies on conditions like component re-renders etc to trigger the actual refetch. Sequence of events: 1) on button click, mutation function is called. 2) on success: the query is marked as stale. (which causes internal state change in useQuery which is also a reason for re-render) 3) setTitle("") causes a re-render 4) component renders and react-query sees the stale query while rendering 5) refetch happens
@maximemondello6174
@maximemondello6174 Жыл бұрын
Subscribed ! exactly what I need to start using the lib ! thanks ;)
@oscardasilva971
@oscardasilva971 Жыл бұрын
Excellent explanation 👏
@bake-holmes
@bake-holmes 8 ай бұрын
Your videos are very helpful, thank you !
@dudeyouhavenoidea
@dudeyouhavenoidea Жыл бұрын
Lol, The Subscribe part made me subscribe, nice
@mdkawsarislamyeasin4040
@mdkawsarislamyeasin4040 Жыл бұрын
Awesome simple example and great tutorials
@xyz9714
@xyz9714 11 ай бұрын
It's really easy to learn things with your nice way of explaining. Can you also talk about state management with react-query and if it's possible to replace redux with it?
@toddd5890
@toddd5890 Жыл бұрын
very very clean tutorial thanks a lot bro
@Murph709
@Murph709 2 ай бұрын
Great tutorial!
@KnownTechnical
@KnownTechnical Жыл бұрын
This helps lot to me brother. subscribed you
@claudioparra8507
@claudioparra8507 7 ай бұрын
just what I needed thank you!
@chinmayghule8272
@chinmayghule8272 9 ай бұрын
I have to say here that this tutorial wasn't noob-friendly at all. I mean, you didn't even explain the difference between query and mutation. For those who don't know, query here means getting the data i.e. a GET request, while a mutation means mutating/changing the data i.e. a POST/PUT/DELETE request.
@brokegod5871
@brokegod5871 2 ай бұрын
If you are learning a library like React Query without even knowing what query/mutation and all those are, that clearly means you don't even know how normal fetching and all works and why React Query exists in the first place. Riding the hype train much?
@MohammedAli-p7e9d
@MohammedAli-p7e9d Ай бұрын
​@@brokegod5871 yea, I feel like I am missing something in my learning journey about fetching data. Can you recommend me some resources please?
@vaysberg_
@vaysberg_ 7 ай бұрын
Great video, thank you ❤. One question on my mind... what is the point of using state manager if this library provides such incredible possibilities for customizing cache? I just watched the video, I will think about it myself, I just want to know feedback from experienced people who have worked with this library.
@ai-yw3zn
@ai-yw3zn Жыл бұрын
I'm doing the same as you. Can you show me the folder structure like the video you made so I can follow along and understand it easily when I learn about it?
@SarahAyuNanda-qr6bm
@SarahAyuNanda-qr6bm 7 ай бұрын
thanks a lot, and i wonder what extension you use so your next code will be auto shown while you're typing
@satellitesage2487
@satellitesage2487 6 ай бұрын
I had a hard time getting the expected behavior for `staleTime: Infinity`. I accidentally placed the instantiation of query client inside of the component, hence, it was always refetching even though I've set the staleTime to Infinity.
@hesam-init
@hesam-init Жыл бұрын
react query changed my life :0
@cosdensolutions
@cosdensolutions Жыл бұрын
Same
@bhargavkumar
@bhargavkumar Жыл бұрын
How to fetch data on the server and then show it to the client in Nextjs app router using Tanstack Query.?
@cosdensolutions
@cosdensolutions Жыл бұрын
that's a bit more complicated. it's still a work in progress last I've heard
@arpithagm2231
@arpithagm2231 7 ай бұрын
is onSuccess being deprecated from useInfiniteQuery? If so, what is the alternative for onSuccess?
@arnauddsj-monagencecreative
@arnauddsj-monagencecreative Жыл бұрын
very well explained thanks a lot
@TheMikkelet
@TheMikkelet 3 ай бұрын
On react native, does it cache with persistent storage or just from ram? If I enable cache and kill the app, will it refetch?
@syedmusab2372
@syedmusab2372 Жыл бұрын
Worthy video ❤
@lumierre0791
@lumierre0791 11 ай бұрын
Very straightforward tutorial! Can I use the React Hook form and React Query at the same time or is it recommended just the React Query only? What combinations would you recommend? Let's say I'm gonna use the Laravel/Express as my backend.
@cosdensolutions
@cosdensolutions 11 ай бұрын
You can definitely combine the two. React Query is async state management, and RHF is form management, so they do different things. But you can use the result of RHF submit to update RQ query cache and see your data, or trigger a refetch by invalidating the cache
@lumierre0791
@lumierre0791 11 ай бұрын
@@cosdensolutions thank you sir, hoping you can have a tutorial on how to combine these two. Thank you
@nawazishali274
@nawazishali274 Жыл бұрын
Hi Cosden can you tell about react query useQuery onSuscess has been depricated in latest version of react query ..what's it alternative ?
@stevebuonincontri6853
@stevebuonincontri6853 3 ай бұрын
what copilot plugging are u using - Im in webstorm
@CodeHassanX
@CodeHassanX Жыл бұрын
amazing videos, thanks
@eedelson1030
@eedelson1030 Жыл бұрын
What autofill extensions are you using? They look extremely helpful. I kept watching and answered my own question. Copilot. This tutorial was so helpful!
@cosdensolutions
@cosdensolutions Жыл бұрын
Haha there you go☺️
@bardhokajvazi2726
@bardhokajvazi2726 11 ай бұрын
Somehow using the onSuccess of useMutation with the useQueryClient doesn’t work. Do you have an idea why ?
@muhammadaamirkhan9185
@muhammadaamirkhan9185 Жыл бұрын
Does Reactquery Fn() executed again and again on every render if no taleTime is set? or it will first execute on the mount and then cache that data, and then on every render it will show the cached data ?? anyone please guide.. I am cleared that on first mount the queryFn data will be cached and then on every mount the cached data will be shown without executing the queryFn . (when taleTime is set to Infinity).. But my question is regarding rendering ..
@narayanapudoor9321
@narayanapudoor9321 8 ай бұрын
Awesome video. Thanks
@alexandrefortes4571
@alexandrefortes4571 11 ай бұрын
There is any video explaining prefetchQuery ?
@micostco
@micostco Жыл бұрын
Amazing tutorial.
@suzanne_atkinson
@suzanne_atkinson Жыл бұрын
How do you access a cache from a nested child? I have a success Modal that writes new data to the database at the end of series if interactions. Because it’s a patch request I have to provide the full nested array plus the new item. How do I access the original data from deep within a nested react app? Is that a. Refetch?
@cosdensolutions
@cosdensolutions Жыл бұрын
You'd have to use the query key to get the cache. There are functions in the documentation that allow you to do that! Everything goes by the query key so as long as you have that, you can get all the data
@joeblack8843
@joeblack8843 8 ай бұрын
jo, your vscode theme is slick. I like how the code is poping out. whats the name of it?
@ryuusha5339
@ryuusha5339 8 ай бұрын
thanks, i tried using it for data deletion, but if I try to delete multiple data , the invalidate queiy only triggers for the first time: the onsuccess function is triggered every time but invalidate only works for the 1st time, anyone know the solution for my problem?
@andreenoviyandy8614
@andreenoviyandy8614 Жыл бұрын
is there any consideration you don't call refetch function from usequery into onSuccess useMutation instead of using useQueryProvider invalidate queries?
@cosdensolutions
@cosdensolutions Жыл бұрын
because that query might also be used in another component somewhere else in the app, and that one should also be invalidated as well to get the latest data! Calling refetch here would only apply to this component
@RajGupta-cu9hi
@RajGupta-cu9hi 11 ай бұрын
In React query 5 ,how to handle onSuccess ,onError 😢
@fahadabbas5252
@fahadabbas5252 Жыл бұрын
Is cacheTime deprecated in latest react Query? because when i type "s" it suggests staleTime but when i type "c" it doesn't show any suggestions also using cacheTime : 0, it still stores everything in cache.....
@cosdensolutions
@cosdensolutions Жыл бұрын
yeah, it got renamed to gcTime for garbage collection time!
@jay-kv6wn
@jay-kv6wn Жыл бұрын
Excellent video
@johndoe4016qweasd
@johndoe4016qweasd Жыл бұрын
Awesome! Thank you!
@javierlimontaneyra2637
@javierlimontaneyra2637 Жыл бұрын
Hi. Thanks a lot for this video. Very clean, informative and objective. It's possible to explain in a video an example o a simple explanation of the use of GraphQL Subscriptions using React-Query??
@MikeNeder
@MikeNeder Жыл бұрын
GraphQL and React-query in the same app? is that necessary?
@javierlimontaneyra2637
@javierlimontaneyra2637 Жыл бұрын
@@MikeNeder Yes.
@Vlad-gr9ds
@Vlad-gr9ds Жыл бұрын
What is the extension which gives inline "You 3 hours ago Initial commit"?
@cosdensolutions
@cosdensolutions Жыл бұрын
git lens
@aymanechaaba
@aymanechaaba Жыл бұрын
How do you revalidate data when we're fetching on rsc?
@stevebuonincontri6853
@stevebuonincontri6853 3 ай бұрын
do u have the source code public? U did not show us the TodoCard code and the Todo code
@ksjazzguitaryt
@ksjazzguitaryt Ай бұрын
Why does search need to be an object in the query key. Why is it `["todos", { search }]` instead of `["todos", search]`?
@cosdensolutions
@cosdensolutions Ай бұрын
if you only ever will need the search, no need for object. But usually, you have search, limit, offset, etc. so object makes more sense
@nitay2870
@nitay2870 Күн бұрын
what about axios libary also great
@ronitmitra3144
@ronitmitra3144 8 ай бұрын
Simple ND TO THE POINT
@vellankiindeevar5530
@vellankiindeevar5530 Жыл бұрын
bro make a tutorial about react table also . you make things really through . plzz
@mammad_mpk1309
@mammad_mpk1309 Жыл бұрын
clean and contentfull
@fernandosoaresdev
@fernandosoaresdev Жыл бұрын
Hello! What ChatGPT extension are you using?
@cosdensolutions
@cosdensolutions Жыл бұрын
copilot!
@chiragagrawal3501
@chiragagrawal3501 10 ай бұрын
Can someone tell me the extension name that provides code suggestion, like in the video above.
@cosdensolutions
@cosdensolutions 10 ай бұрын
github copilot
@Drayken
@Drayken 7 ай бұрын
Probably should've included parts for: useQueries, dependent useQuery and dependent useQueries.
@regilearn2138
@regilearn2138 4 ай бұрын
teach us how to use redux toolkit and Tanstack query together
@alyu6351
@alyu6351 2 ай бұрын
a senior developer in 19min? I'm in
@joenguyen8204
@joenguyen8204 6 ай бұрын
awsome, good stuff
@pointer333
@pointer333 2 ай бұрын
When you're conducting a tutorial, and you realize you haven't breathed once in 5 minutes straight, you need to slow down. It's like you're racing to finish. At that point, it's a "hurried demo" at best.
@Ryku_Prime
@Ryku_Prime Жыл бұрын
What theme are you using?
@cosdensolutions
@cosdensolutions Жыл бұрын
Material theme darker
@Ryku_Prime
@Ryku_Prime Жыл бұрын
@@cosdensolutions Thank you!
@thothhermes7270
@thothhermes7270 3 ай бұрын
Thanks bro.
@kiranm5419
@kiranm5419 Жыл бұрын
Awesome Video
@leonardmbibi8013
@leonardmbibi8013 7 ай бұрын
Nice one from a nice guy. Your link to 🚀Project React is not working.
@leonardmbibi8013
@leonardmbibi8013 6 ай бұрын
Ok, It's working now. Thanks
@yonseungkim
@yonseungkim Жыл бұрын
what vs code extension do you use for chat-gpt?
@cosdensolutions
@cosdensolutions Жыл бұрын
Copilot
@musicanon1
@musicanon1 Жыл бұрын
Have you tutorial about rtq ?
@cosdensolutions
@cosdensolutions Жыл бұрын
not yet
Cypress Testing with React - Simple Tutorial
12:43
Cosden Solutions
Рет қаралды 58 М.
Combining Zustand with React Query
20:24
Cosden Solutions
Рет қаралды 33 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Why I don't use React-Query and tRPC in Next.js
18:58
ByteGrad
Рет қаралды 102 М.
Modern Data Fetching in React (Complete Guide)
16:41
Cosden Solutions
Рет қаралды 79 М.
Learn React Hooks: useMemo - Simply Explained!
13:41
Cosden Solutions
Рет қаралды 121 М.
React Query Makes Writing React Code 200% Better
13:54
Web Dev Simplified
Рет қаралды 199 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 906 М.
The Story of React Query
8:55
ui․dev
Рет қаралды 117 М.
React Query за 10 минут! Быстрый курс
11:34
Archakov Blog
Рет қаралды 59 М.
Learn React Query In 50 Minutes
51:09
Web Dev Simplified
Рет қаралды 320 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 908 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН