Brilliant. I've been on a project at work, in a fairly large codebase using react query already, and I'm still learning react itself, so there has been a lot to get my head around. This helped me a lot!
Hello Dave, I have watched almost all of your video tutorials. If you have some time, I am expecting a socket io And a sequalize tutorial from you. Please carry on. Thank you.
I do plan to do a TypeScript series this year. I'm for beginners first, and they need to learn before moving to TS, too. You'll see both with and without here in the future 💯
Hi, Dave! Your video is super existing to watch and teach myself a little bit but my sort function is now working (todo items go to the very bottom of list). Don't have any clue why it is working that way.. Even despite taking and pasting your code from the git hub source.
Great work! Loved your video. Just one thing I'm not quite understanding... where are we mapping our ./data/db.json to the Todo api? how does the app knows?
Going by memory here - If I used json-server as a dev database, when you launch json-server, it tells you the address and port number it is available on.
@@DaveGrayTeachesCode It will work for the best same, As you may know, Next.js will make some major changes in their routing/layout system according to their latest blog posts, so the tutorials would be kinda outdated with the new version finally comes out. 😀
I was going to ask you the "fetch" vs. "axios", is it still relevant today to use "axios"? I saw you are using it in React tutorial. Lately I've been considering React Query and will definitely check out this video too!
Do you think it’s ok to use react query to fetch data from the backend services and at the same time use redux toolkit to persiste some info that comes from those requests?! Let’s say I want to save user info so that it can be seen from different screens. I’m not sure about how to go with that, it feels “wrong”, at the same time I don’t like RTK Query very much since it’s more opinionated
You can use Axios with Async Thunks. I show that in my Redux course before moving on to RTK Query. That said, you can also use Axios with RTK Query although I did not demonstrate it. You can implement it as shown in the docs here: redux-toolkit.js.org/rtk-query/usage/customizing-queries#axios-basequery
I absolutely love your channel. Of course i just subscribed lol. I have a question please. Do you have a video with Reactquery with jwt refresh tokens? and rbacs? basically with the middleware ? thanx a lot for everything. you are the real MVP lol.
Thank you! No I do not currently. You could take what is in my React Auth playlist and apply it with React Query though. I should cover this with RQ in the future.
Hi Dave. Thank you for this video. So you prefer redux and rtk query. Is it redux toolkit and rtk query? If so, do you have a repo project for that? Thank you!
Based on project size and needs, I would choose. I do have a full modern Redux course with Redux Toolkit and RTK Query: th-cam.com/video/NqzdVN2tyvQ/w-d-xo.html
in this video, he was showed to us to use react-query and react-query is different package with rtk query..rtk-query is addon with in rtk package. im prefer to use rtk-query instead of react-query. for me it seems a bit similiar with react-query. repo rtk-query: shorturl.at/jsvG7
Thanks for this video. Also is this the same as TanStack Query ?; as far i know should be the same, the only difference is TanStack is avaiable for other frameworks.
Great video! quick question, how React Query says, do u even use Redux anymore? Watching this video I can say it is better and more clean code than using Redux, Thunks and things like that. What do u think? I just started a big Proyect and we decided to use React Query for all our work, but that, more understanding using React Query than others libraries
In one of the large-scale projects, I am planning to use Redux-Toolkit for "client state" management, as I have so many modules and features such as Search, Advance Filter, infinite scrolling etc. So that I can store the state in the Redux toolkit using store and slices. Now I love React-Query because of "useInfiniteQuery", but I don't want to increase the bundle size as well by installing another library. One of the use case: When I get the list of data from the server, I want to cache the data, and if the user search or filter the data, I want to store the "searchText" and "FilterData" in the state, so when user navigate between pages and come back to the listing page, I can simply provide the already filtered data, that will sure improve the UX. So is it a good idea to stick with RTK Query as it is available inside the Redux-toolkit package and be in the same eco-system?
If you're using Redux Toolkit I would probably just stick with RTK Query since it is built on top of Redux Toolkit and Redux Toolkit is built on top of Redux. It's like an all-in-one package to take care of both server and client side state. Plus you can pass in your RTK query reducers into your general Redux store along with the reducers for your client side stuff. So you can create one Redux store to hold both of your client and server side states. A more lightweight solution could be Zustand for client side state and React Query for server side state. It tends to keep things more simple and less convoluted than Redux.
In your opinion what is best for a react store? An example is a store containing the following: JWT access token, refresh token, name, credit card token etc. I have feeling you will say RTK but do you think RQ is good also?
Good question - and definitely just an opinion as there is no right or wrong here. Whatever you like and are most comfortable with will work. Redux & RTK Query are usually for more enterprise (large) apps. I would reach for React Query or similar in most small to medium projects, but there are some considerations. React Query works with caches. If you need some local state in addition, you could use the built-in Context API whereas RTK Query can just use Redux for state.
I can do another video. I cannot update a video that is already published. Overall, this intro tutorial just covers the basics, and I don't think much has changed for these.
Hi Dave, We would like intermediate to advanced react or mern stack projects. That would be so useful for us after all these great tutorials. Thank you for all.
freaking awesome dude. cool! could you do another video with swr maybe with React/Next.js by any chance tho? really appreciate this hard work anyway 🎉🎉
The starter code does not have the dependencies because I walk you through adding them in the tutorial. However, if you look at the completed project, all of the dependencies are already listed in the package.json. Clone the repository and then run npm update to install all of the dependencies.
Thanks for the video, great intro to react-query. Quick question if you don't mind. Why do you use a variable with JSX instead of a Component? (e.g. newItemSection), is there any benefits to this or is it personal preference?
Good question! It is something I started doing awhile back. I like defining everything including what I am going to return, but there is no requirement to do so.
on rtk query vs react query.. seems react query is much simpler to implement.. since rtk query is supported by the same redux team.. hav some advantage.. What do you think Dave?
Yes, I do agree that React Query is an easier implementation. If you do not have a large project - specifically if you do not need global state management - React Query is a good choice. RTK Query integrates with Redux and is great when you do need global state management.
Thank you, Henrique! 🙏 I want to provide both. I will make a TypeScript tutorial series that will allow me to refer beginners back to it when I do other tutorials with TS. I always want to keep things beginner friendly along the way. 🚀
Hi Rakhi, as I mentioned in the video, it is really situational but I lean towards RTK Query. Redux is a marketable skill that could help with jobs and RTK Query is part of modern Redux. 🚀
Дэйв, спасибо, отличный обзор библиотеки Но хотелось бы увидеть весь потенциал, напримере какого нибудь список дел, чтобы можно было отметить готово дело или нет, с отдельной страницей каждого дела, с пагинацией и чтобы не было перерендеров (наверное это ключевое) =)
Nice video. One question though... What do you think of redux-saga for doing asynchronous task. I have seen that it still has over a million downloads on npm. So, what would be good of big projects ? Is it saga or rtk-query?
Hey Dave, another great vid, thank you. I'm using React Query for a project and have the basic fetching and mutations going - one thing I'm wondering if it's possible to do is when a component/page loads, check react-query data I have in cache already from other pages for a matching id to save having to fetch this item again. If it's there, just use that data. If not, fetch the data. Is this possible, or way too much to be doing? I've been trying to figure out for ages now but can't quite figure it out..
React Query accepts a function where you can select the data you need. Let's say you query users data for a users list and then go to an individual users page. You can pass a select function into the same query on the individual user page. It should used the cached data instead of making a new request - unless the cache has expired. You can control this expiry with more detail by following the example under "Conditional Initial Data from Cache" here: tanstack.com/query/v4/docs/guides/initial-query-data
@@DaveGrayTeachesCode Thanks, I'll dig into this! My possible issue is having a separate cache for the individual items and then all items. I'd like to check [all-items] cache for an id that matches one passed as a param to the indiv item page, if there, populate the [indiv-item] cache with this data (but if the cache doesn't exist yet.. ??) A lot to figure out, but I'll start with that link and hopefully can get there.
I think you need to be using Firebase which would be your backend - or at least your database. You can learn more about react-query-firebase here: react-query-firebase.invertase.dev/
Does it make sense to be ReactJS developer but not to be css expert? I mean css it's self is way more complex with responsiveness and pixel perfection. While css expert struggling in integration of payment gateways, and other 3rd party services etc a ReactJS developer could be much more comfortable in those things
You don't have to be a CSS expert. It does help to know the fundamentals. Likewise, a CSS expert does not need to be a JS expert, but it also helps a CSS expert to know JS fundamentals.
Redux is created by an team, and does fix two React app problems, while Redux Query is an one dev show, if something happened to this dev or maybe one day when he lost interest the package is doomed. Next to that unlike Redux your api code is all over the place...
Good points! Yes, React Query offers more flexibility (less opinionated) but that does put some code a bit more "all over the place" as you say. I like using Axios with it, but I really like the more opinionated organization of RTK Query. I'll likely use both depending on the project. Enterprise/production for work will definitely be modern Redux and RTK Query.
Good catch! So for anyone reading - outside of a try/catch block "return await" is redundant. It doesn't hurt anything but is unnecessary. I have "return await" on the addTodo, updateTodo, and deleteTodo. The await can be removed there. Do not remove it from getTodos though! Good article on this from Jake Archibald here: jakearchibald.com/2017/await-vs-return-vs-return-await/
i didin't understand how did you increment the id without adding it to the todo : addTodoMutation.mutate({ userId: 1, title: newTodo, completed: false })
Absolutely underrated gem of a channel. This was such a brief yet thorough
Thank you, Hamzah!
Brilliant. I've been on a project at work, in a fairly large codebase using react query already, and I'm still learning react itself, so there has been a lot to get my head around. This helped me a lot!
Glad it was helpful! 💯
Much simpler than RTK Query! Thanks
Dave, you're definetly raising the bar!
Thank you, Raffaele!
as your lesson its clear that rtk and react query use case depends on the size of project.
What a fantastic video. Everything explained so concisely and clearly. Thank you!
You're very welcome!
Videos like this will be interesting!! Concentrating on one task! And explaining different methods by which we can achieve the task!
Glad you like it! 💯
Thx! I use RQ and Recoil at the moment.
Hello Dave, I have watched almost all of your video tutorials. If you have some time, I am expecting a socket io And a sequalize tutorial from you. Please carry on. Thank you.
You're welcome and thank you for the requests! 🙏💯
Another excellent tutorial! You sir and net ninja are the best out there!! Ty!!!!
Wow, thanks! 🙏 You have put me in great company, and I sincerely appreciate the kind words!! 💯
really love all your videos,just one request could you please write in typescript rather than JS……that will be more helpful
I do plan to do a TypeScript series this year. I'm for beginners first, and they need to learn before moving to TS, too. You'll see both with and without here in the future 💯
@@DaveGrayTeachesCode that's amazing,that's for your time
Hi, Dave! Your video is super existing to watch and teach myself a little bit but my sort function is now working (todo items go to the very bottom of list). Don't have any clue why it is working that way.. Even despite taking and pasting your code from the git hub source.
thx. straight to the point and this one is very easy to understand.
Welcome!
Great work! Loved your video.
Just one thing I'm not quite understanding... where are we mapping our ./data/db.json to the Todo api? how does the app knows?
Going by memory here - If I used json-server as a dev database, when you launch json-server, it tells you the address and port number it is available on.
I too like RTK Query with Redux
Just curious, is there any to-do for making videos about nextjs in your to-do list.😅
😂 later this year is the plan. MERN and Typescript had more votes and will come first 🚀
@@DaveGrayTeachesCode you can do MERN with Next.js...
@@codernerd7076 yes, but I always like to provide a foundational tutorial series first. That lets me refer back to it when answering questions.
@@DaveGrayTeachesCode It will work for the best same, As you may know, Next.js will make some major changes in their routing/layout system according to their latest blog posts, so the tutorials would be kinda outdated with the new version finally comes out. 😀
@@codernerd7076 Right! Technology keeps moving 🚀
I was going to ask you the "fetch" vs. "axios", is it still relevant today to use "axios"? I saw you are using it in React tutorial.
Lately I've been considering React Query and will definitely check out this video too!
Yes, you can use Axios. You can even use Axios with React Query! I hope the video helps!
Excellent Tutorial on React-Query. Thanks, Dave
{2022-10-13}, {2022-11-10}, {2022-11-17}
Glad it was helpful!
Do you think it’s ok to use react query to fetch data from the backend services and at the same time use redux toolkit to persiste some info that comes from those requests?! Let’s say I want to save user info so that it can be seen from different screens. I’m not sure about how to go with that, it feels “wrong”, at the same time I don’t like RTK Query very much since it’s more opinionated
"let me know what you like in the comments" well ...... I like your videos so please for the humanity future keep going making this great content
Thank you, I will! 💯🚀
Dave your way of teaching is just awesome♥️
You and john smilga are best instructors for web development
Thank you for the kind words, Mohammad! 🙏 It's an honor to be mentioned with John 💯
Thanks a lot. Can we use useQuery for GET and for post, put and delete we use useMutation?
Yes, that is the idea! 💯
congratulations !! very good. so that I use an add function on another page, for example, just import TodoList and use the addTodoMutation function?
TodoList is a component in this video. If using addTodoMutation, you also need to import the addTodo function.
Please what programming font are you using? The one in this video seems pretty decent. Taking this as a crash course
I show my font choices in this short: th-cam.com/users/shortsf1HVI5slxms
hello, may i know why u used the select meanwhile the docs said that the third parameter is for the cache time? thank you
While mutating does all todos re render?????
Thanks! Mr. Dave
You're welcome Faris! 💯
Does components render or update if server state changes in React query ? I mean without maintaining additional client state.
What is your opinion on using Redux and Axios (instead of RTK) for a big project? I just love using axios.
You can use Axios with Async Thunks. I show that in my Redux course before moving on to RTK Query. That said, you can also use Axios with RTK Query although I did not demonstrate it. You can implement it as shown in the docs here: redux-toolkit.js.org/rtk-query/usage/customizing-queries#axios-basequery
Thank you Mr Dave
so the content variable was not a state variable and yet the changes were reflected like it was a state variable? how
I absolutely love your channel. Of course i just subscribed lol. I have a question please. Do you have a video with Reactquery with jwt refresh tokens? and rbacs? basically with the middleware ? thanx a lot for everything. you are the real MVP lol.
Thank you! No I do not currently. You could take what is in my React Auth playlist and apply it with React Query though. I should cover this with RQ in the future.
@@DaveGrayTeachesCode Thanx a lot
Hi Dave. Thank you for this video. So you prefer redux and rtk query. Is it redux toolkit and rtk query? If so, do you have a repo project for that? Thank you!
Based on project size and needs, I would choose. I do have a full modern Redux course with Redux Toolkit and RTK Query: th-cam.com/video/NqzdVN2tyvQ/w-d-xo.html
in this video, he was showed to us to use react-query and react-query is different package with rtk query..rtk-query is addon with in rtk package. im prefer to use rtk-query instead of react-query. for me it seems a bit similiar with react-query.
repo rtk-query: shorturl.at/jsvG7
I was going through the documentation and sir you dropped a video. Thank you very much for such great tutorials! Also 69th like. Nice
Thank you, Akshay! 🙏 Good timing!
I am getting an network error with checkbox element and it is not getting checked on unchecked.
You can compare to my source code to find the difference.
Thanks for this video.
Also is this the same as TanStack Query ?; as far i know should be the same, the only difference is TanStack is avaiable for other frameworks.
Yes, it was previously called React Query. The overall concept is the same but there may have been a few updates since I made this video.
Thank you very much for your lessons Dave. You are helping lots of people around the world. Could you please update this course to tanstackQuery v5
Great request! I need to do this.
@@DaveGrayTeachesCode Great tysm, then I look forward to it.
super helpful video yet again Dave ... 💯
Glad to hear it! 🙏
@@DaveGrayTeachesCode 🤩
i have question for can you tell something when will MERN project will come ? and which type of that project like ecommerce or blog website ?
MERN project later this summer. Not a blog but something based on examples where I can highlight what is needed.
thanks for the tutorial again! do you have any plans for projects?
Yes, a MERN project later this summer. 🚀
Great stuff! Thanks so much for sharing :)
Glad it was helpful!
Excellent tutorial,thank you gray
Very welcome!
Awesome tutorial thank you, regarding your question, i prefer React Query more than Redux RTK Query
Thanks for the feedback, Sona!
@@DaveGrayTeachesCode You are welcome
Is it possible to use react query in project redux toolkit is used for state managmemt ?
You mean instead of Redux Toolkit? Yes. If you mean at the same time - I don't think I would use them together.
Great video! quick question, how React Query says, do u even use Redux anymore?
Watching this video I can say it is better and more clean code than using Redux, Thunks and things like that. What do u think? I just started a big Proyect and we decided to use React Query for all our work, but that, more understanding using React Query than others libraries
React Query is a great choice for many projects! I like it! 💯
In one of the large-scale projects, I am planning to use Redux-Toolkit for "client state" management, as I have so many modules and features such as Search, Advance Filter, infinite scrolling etc. So that I can store the state in the Redux toolkit using store and slices. Now I love React-Query because of "useInfiniteQuery", but I don't want to increase the bundle size as well by installing another library.
One of the use case: When I get the list of data from the server, I want to cache the data, and if the user search or filter the data, I want to store the "searchText" and "FilterData" in the state, so when user navigate between pages and come back to the listing page, I can simply provide the already filtered data, that will sure improve the UX.
So is it a good idea to stick with RTK Query as it is available inside the Redux-toolkit package and be in the same eco-system?
If you're using Redux Toolkit I would probably just stick with RTK Query since it is built on top of Redux Toolkit and Redux Toolkit is built on top of Redux. It's like an all-in-one package to take care of both server and client side state. Plus you can pass in your RTK query reducers into your general Redux store along with the reducers for your client side stuff. So you can create one Redux store to hold both of your client and server side states.
A more lightweight solution could be Zustand for client side state and React Query for server side state. It tends to keep things more simple and less convoluted than Redux.
@@chrisstucker1813 Thanks for the response.
Staying in the ecosystem would make more sense.
Thank you.
Thank you for making this tutorial.
You're very welcome!
In your opinion what is best for a react store? An example is a store containing the following: JWT access token, refresh token, name, credit card token etc. I have feeling you will say RTK but do you think RQ is good also?
Good question - and definitely just an opinion as there is no right or wrong here. Whatever you like and are most comfortable with will work. Redux & RTK Query are usually for more enterprise (large) apps. I would reach for React Query or similar in most small to medium projects, but there are some considerations. React Query works with caches. If you need some local state in addition, you could use the built-in Context API whereas RTK Query can just use Redux for state.
@@DaveGrayTeachesCode cool ty
Amazing video as always
I dont understand why when I am using React Query in Observers I get 26 or 29 in it. You can say why?
22:23 for update todo logic
Hi Dave!
Can you make an accessibility course so our websites become more useable.
Thanks for asking! This is an item on my ToDo list! It is something I definitely want to create. 🚀
do you think for the job of junior react developer react query is needed?
It is good to know. Specifically it will depend on the job.
Awesome tutorial, thx!
Glad it was helpful!
9:50 I did this like this at work and I was called out because they say you're not supposed to have so many similar CRUD methods.
Thank you so much for videos
You're welcome!
Would you update this course to use React Query v4?
I can do another video. I cannot update a video that is already published. Overall, this intro tutorial just covers the basics, and I don't think much has changed for these.
Hi Dave,
We would like intermediate to advanced react or mern stack projects. That would be so useful for us after all these great tutorials. Thank you for all.
You're welcome! Have you tried my MERN Stack Course? It's a big project: th-cam.com/video/CvCiNeLnZ00/w-d-xo.html
Really good content, I'm new to react and these videos are a great way to learn.
Glad to hear it!
freaking awesome dude.
cool!
could you do another video with swr maybe with React/Next.js by any chance tho?
really appreciate this hard work anyway 🎉🎉
Looking forward to covering Next.js later this year! 🚀
Thanks for your tutorial.
You're welcome! 💯
Why the github repository linked below doesn't have any dependency in package.json in both intro and starter.. there is only css code..?
The starter code does not have the dependencies because I walk you through adding them in the tutorial. However, if you look at the completed project, all of the dependencies are already listed in the package.json. Clone the repository and then run npm update to install all of the dependencies.
Thanks for the video, great intro to react-query.
Quick question if you don't mind. Why do you use a variable with JSX instead of a Component? (e.g. newItemSection), is there any benefits to this or is it personal preference?
Good question! It is something I started doing awhile back. I like defining everything including what I am going to return, but there is no requirement to do so.
on rtk query vs react query.. seems react query is much simpler to implement.. since rtk query is supported by the same redux team.. hav some advantage.. What do you think Dave?
Yes, I do agree that React Query is an easier implementation. If you do not have a large project - specifically if you do not need global state management - React Query is a good choice. RTK Query integrates with Redux and is great when you do need global state management.
fully agree.. ✌
Thank you so much!
You're welcome! 💯
I learned a lot today.
Glad to hear that!
you do amazing videos, but plz could you do then with typescript ? would be amazing if you can do it, the market almost always expect for typescript
Thank you, Henrique! 🙏 I want to provide both. I will make a TypeScript tutorial series that will allow me to refer beginners back to it when I do other tutorials with TS. I always want to keep things beginner friendly along the way. 🚀
Hi Dave, I absolutely love your tutorials. Can we know if you'll be making any fullstack (Typescript) tutorials as well ?
Eventually, yes. I want to do a TypeScript series first. That will allow me to refer beginners back to it for fundamentals & questions. 🚀
awesome tutorial
Thank you, Dharmesh! 💯
Bro if you have one choice which one you choose rtk query or react query?
Hi Rakhi, as I mentioned in the video, it is really situational but I lean towards RTK Query. Redux is a marketable skill that could help with jobs and RTK Query is part of modern Redux. 🚀
man you're just so amazing
Thank you! 🙏
Awesome one 🙂
Thanks 💯
Дэйв, спасибо, отличный обзор библиотеки
Но хотелось бы увидеть весь потенциал, напримере какого нибудь список дел,
чтобы можно было отметить готово дело или нет, с отдельной страницей каждого дела, с пагинацией и чтобы не было перерендеров (наверное это ключевое) =)
Thank you! Yes, you could go deeper here. Create a component for each Todo and use React.memo on those components to prevent unnecessary re-renders.
@@DaveGrayTeachesCode React.memo - Is there only one way to solve this problem?
@@viktorkasap no but it's usually the solution I prefer.
@@DaveGrayTeachesCode Thank you very much 🙏
Nice video. One question though... What do you think of redux-saga for doing asynchronous task. I have seen that it still has over a million downloads on npm. So, what would be good of big projects ? Is it saga or rtk-query?
Great question! I should do a comparison 💯 After completing my Redux series, I wanted to do a few other topics, but I'll get back to it. 🚀
@@DaveGrayTeachesCode is this out?
@@none0n I did not do this yet. So many topics to cover! 😀My channel is searchable from the channel homepage.
@@DaveGrayTeachesCode fingers crossed. I’m trying to design a Frontend style that’s reusable. This video helped me understand react query
Hey Dave, another great vid, thank you. I'm using React Query for a project and have the basic fetching and mutations going - one thing I'm wondering if it's possible to do is when a component/page loads, check react-query data I have in cache already from other pages for a matching id to save having to fetch this item again. If it's there, just use that data. If not, fetch the data. Is this possible, or way too much to be doing? I've been trying to figure out for ages now but can't quite figure it out..
React Query accepts a function where you can select the data you need. Let's say you query users data for a users list and then go to an individual users page. You can pass a select function into the same query on the individual user page. It should used the cached data instead of making a new request - unless the cache has expired. You can control this expiry with more detail by following the example under "Conditional Initial Data from Cache" here: tanstack.com/query/v4/docs/guides/initial-query-data
@@DaveGrayTeachesCode Thanks, I'll dig into this! My possible issue is having a separate cache for the individual items and then all items. I'd like to check [all-items] cache for an id that matches one passed as a param to the indiv item page, if there, populate the [indiv-item] cache with this data (but if the cache doesn't exist yet.. ??) A lot to figure out, but I'll start with that link and hopefully can get there.
@@thattablebloke look at "select-partial-subscriptions" : tkdodo.eu/blog/react-query-data-transformations
@@DaveGrayTeachesCode Great, thanks so much, will have a good look.
do I need backend to use react-query-firebase
I think you need to be using Firebase which would be your backend - or at least your database. You can learn more about react-query-firebase here: react-query-firebase.invertase.dev/
@@DaveGrayTeachesCode I make Todo app with only React and Firestore onSnapshot. I have getting data delay about 1.3 second
Awesome video as always ++++++++++++++++ 🙂
Thank you!
Does it make sense to be ReactJS developer but not to be css expert?
I mean css it's self is way more complex with responsiveness and pixel perfection.
While css expert struggling in integration of payment gateways, and other 3rd party services etc a ReactJS developer could be much more comfortable in those things
You don't have to be a CSS expert. It does help to know the fundamentals. Likewise, a CSS expert does not need to be a JS expert, but it also helps a CSS expert to know JS fundamentals.
nice content, can we have a interval fetch with react-query?
Thank you, Daniel 🙏 I think you may be referring to auto-refetching: react-query.tanstack.com/examples/auto-refetching
Ohh yes just awesome plz perform CRUD with react query in easy way..
That is what this video is about. React Query with easy CRUD examples.
Redux is created by an team, and does fix two React app problems, while Redux Query is an one dev show, if something happened to this dev or maybe one day when he lost interest the package is doomed. Next to that unlike Redux your api code is all over the place...
Good points! Yes, React Query offers more flexibility (less opinionated) but that does put some code a bit more "all over the place" as you say. I like using Axios with it, but I really like the more opinionated organization of RTK Query. I'll likely use both depending on the project. Enterprise/production for work will definitely be modern Redux and RTK Query.
i remove redux from my life . react query is so useful
Something really small, no need to await from the return statement.
Good catch! So for anyone reading - outside of a try/catch block "return await" is redundant. It doesn't hurt anything but is unnecessary. I have "return await" on the addTodo, updateTodo, and deleteTodo. The await can be removed there. Do not remove it from getTodos though! Good article on this from Jake Archibald here: jakearchibald.com/2017/await-vs-return-vs-return-await/
Damn, it's still too slow at 1.5x speed 🤦♂
I have also been asked to slow down. Summary: I will never please everyone as each person has their own preferences.
Yes, Next Js + Typescript 🥲
i didin't understand how did you increment the id without adding it to the todo :
addTodoMutation.mutate({ userId: 1, title: newTodo, completed: false })
The REST API (backend) does that.
@@DaveGrayTeachesCode thanks!