RTK Query Tutorial - How to Fetch Data With Redux Toolkit Query | React Beginners Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ต.ค. 2022
  • The first 1,000 people to use the link will get a 1 month free trial of Skillshare: ​skl.sh/pedrotech10221
    In this video I will teach you guys how to use redux toolkit to fetch data from API's in react.
    Code: github.com/machadop1407/redux...
    Join our Discord: / discord
    🚀 Learn ReactJS By Building 6 Projects: codedamn.com/learn/reactjs-pr...
    🐙 GraphQL Course: codedamn.com/learn/graphql-fo...
    ► Buy Crypto on Coinbase: coinbase-consumer.sjv.io/PedroTech
    Social
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Website: machadopedro.com
    Linkedin: / machadop1407
    Instagram: / _pedro.machado_
    Github: github.com/machadop1407
    Business Email: pedro@pedrotech.co
    Tags:
    - ReactJS Tutorial
    - ReactJS and MySQL
    - NodeJS Tutorial
    - API Tutorial
    #reactjs #coding
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 97

  • @PedroTechnologies
    @PedroTechnologies  ปีที่แล้ว +6

    The first 1,000 people to use the link will get a 1 month free trial of Skillshare: ​skl.sh/pedrotech10221

    • @ankush0094
      @ankush0094 ปีที่แล้ว

      Hi pedro tech i am learning react and came to know redux for state management, but now i am confused with thunk and rkt query. As i know, thunk is used for handling api, same doing with rtk. So confused about what to use.

  • @daemonelectricity
    @daemonelectricity 2 หลายเดือนก่อน +3

    The example I saw on the Redux documentation did not create another provider. It added the API as a reducer in the store and as a middleware concatenated on getDefaultMiddleware. That approach makes a lot more sense because it would be insane to be nesting 20 providers for 20 API slices.

  • @zuccidaniel8926
    @zuccidaniel8926 9 หลายเดือนก่อน +2

    This is awesome! without even writing a single line of code, i understood what's going on 90%! thanks pedro!

  • @josefreitas6997
    @josefreitas6997 ปีที่แล้ว +3

    Been using it recently with redux, a bit more complex than react-query but a really great tool! Keep up with the good work. Shotout from Portugal

  • @akshaychoudhry
    @akshaychoudhry ปีที่แล้ว +15

    Timestamps:
    0:00 Intro
    0:40 Target Audience
    (1:15-2:01 Skillshare)
    2:02 Project Intro
    2:59: createAPI() function
    9:05 hooks can be used to get data

  • @marvinfok65
    @marvinfok65 4 หลายเดือนก่อน

    I love your lessons & explanations! So simple & concise!

  • @ALi-Sloom
    @ALi-Sloom 8 หลายเดือนก่อน

    you really know how to explain very well.
    when I'm stuck on anything I directly come to you, thank you very much.

  • @bartjan83
    @bartjan83 11 หลายเดือนก่อน

    Super introduction Pedro ! Hoping to see a deep-dive in te future ! Love Bart

  • @user-un5qh6ks1f
    @user-un5qh6ks1f 7 หลายเดือนก่อน

    I had knowledge of RTK query, but couldn't understand it very well.
    This video made it very clear all my previous confusion.

  • @BobbyW0nder
    @BobbyW0nder ปีที่แล้ว

    Excellent video to introduce RTK Query basics! You made it very clear and simple, thank you 🙏

  • @amirhosseinnazari2699
    @amirhosseinnazari2699 ปีที่แล้ว

    Wow. You explained it absolutely great. Now it is much more clear for me. Thank you buddy

  • @eshw23
    @eshw23 ปีที่แล้ว +9

    Just wanna say your channel has helped me build some awesome projects the past few months! An updated MERN project would be amazing if you can anytime soon!

    • @PedroTechnologies
      @PedroTechnologies  ปีที่แล้ว +3

      Great to hear!

    • @regilearn2138
      @regilearn2138 ปีที่แล้ว +3

      @@PedroTechnologies with typescript + rtkQuery with some advanced MERN project would be grate

  • @Winter_Wyvern1
    @Winter_Wyvern1 ปีที่แล้ว

    I just searched this video from u yesterday & dodnt find any, and then next day, today, u are releasing it😂

  • @user-nj6ze3if2b
    @user-nj6ze3if2b ปีที่แล้ว

    Great video, it was really helpful!

  • @user-ok5wr8kx9o
    @user-ok5wr8kx9o ปีที่แล้ว

    Very clear explanation. Thank you for sharing

  • @shinobi_coder88
    @shinobi_coder88 ปีที่แล้ว

    Hi Pedro, thanks for the course. I wanna do SSG fetching with RTK Query in next js. However, I don't feel like wanna use next-redux-wrapper as it's quite overwhelming. Is there any easier alternative?

  • @johnadepelumi93
    @johnadepelumi93 ปีที่แล้ว +1

    Hi Pedro, thanks for all you do to put these tutorials out here for free. I was wondering if you will be doing any tutorials on TDD in react with jest or react testing library
    .

    • @rafaelarantes4804
      @rafaelarantes4804 ปีที่แล้ว +1

      Kent C Dods has nice content about TDD in React. Check it out

  • @RoniJackVituli
    @RoniJackVituli ปีที่แล้ว

    amazing man! thank you very much!

  • @kellyncodes7421
    @kellyncodes7421 ปีที่แล้ว +1

    Thanks for the video pedro

  • @davidriches6452
    @davidriches6452 ปีที่แล้ว +1

    nice tutorial @pedro what vscode theme are you using here?

  • @DashFactsCentral
    @DashFactsCentral 4 หลายเดือนก่อน

    Awesome explaination!

  • @ricko13
    @ricko13 ปีที่แล้ว +1

    Good tutorial, I like it 💪
    I got a question: how set the query parameters in a more elegant way (not hardcoded) like you did with template literals 13:30

  • @rajibhossainprejon5627
    @rajibhossainprejon5627 5 หลายเดือนก่อน

    Very welly explained!!

  • @johanmirzaahmedov7987
    @johanmirzaahmedov7987 ปีที่แล้ว

    I'm just curious if you will have more courses on RTK query, as im not sure how to add more api slices and combine then

  • @sudiptokumarmitra9845
    @sudiptokumarmitra9845 ปีที่แล้ว

    Thanks for this tutorial. But Please make a complete tutorial on Redux toolkit and rtk query and show how to use it for post request and for complex web apps.

  • @geoego23
    @geoego23 ปีที่แล้ว

    Thank you for your work.
    I have a question: how to get base url using hooks? I want to render pictures from API, but API returns only the name of file name, so when I try to render img tag with src from api results, it tries to get it from my url, not from api server. How to write img tag correctly?
    Thank you in advance, greetings from Odessa, Ukraine

  • @neiledwarddelacruz9419
    @neiledwarddelacruz9419 ปีที่แล้ว

    very helpful. thank you

  • @Chris-qg6kc
    @Chris-qg6kc 4 หลายเดือนก่อน

    ✅ You def did a boss job explaining rtk query!

  • @salvaborit
    @salvaborit ปีที่แล้ว +1

    great shit bro keep it up

  • @developedbyjs
    @developedbyjs ปีที่แล้ว +1

    Please Please Create a React Native course, I really like how you teach! If possible thanks

  • @lopghkt
    @lopghkt ปีที่แล้ว

    how about authentication firebase with rtk query? im struggling to find some material, im trying but its hard. And what will be the propperly react-redux-toolkit method of using firebase auth and storage?

  • @yashwanthsrini
    @yashwanthsrini 8 หลายเดือนก่อน

    Nice video. Thanks.

  • @sonamohialdin3376
    @sonamohialdin3376 ปีที่แล้ว

    So good tutorial thank you

  • @NateBoxer-nr7gb
    @NateBoxer-nr7gb 22 วันที่ผ่านมา +1

    tutorial actually starts at 2:02

  • @NAYY_STUDIOS
    @NAYY_STUDIOS 7 หลายเดือนก่อน

    Can I use the CreateApi and fetchBasequery to fetch some data from my mongodb.

  • @soyebmohammad07
    @soyebmohammad07 5 หลายเดือนก่อน

    Top notch

  • @jonathankayizzi1241
    @jonathankayizzi1241 ปีที่แล้ว

    Great tutorial

  • @sohadmad1823
    @sohadmad1823 ปีที่แล้ว

    Amazing!!!!!!!!

  • @InsaaZayn
    @InsaaZayn ปีที่แล้ว

    Bro you're great

  • @piyushaggarwal5207
    @piyushaggarwal5207 ปีที่แล้ว

    Really awesome tool

  • @dedenapraia
    @dedenapraia 8 หลายเดือนก่อน

    Thank you for this tutorial, a thing that is not clear to me is how to store the data in the redux store. When I open the redux chrome extension I see only query, mutation, etc but not the actual data

  • @developertak
    @developertak ปีที่แล้ว

    Hey pedro can you make a video on firebase authentication useing typescript and create context hook

  • @dever312
    @dever312 10 หลายเดือนก่อน

    Bless you bro

  • @ayyappaalampalli4632
    @ayyappaalampalli4632 ปีที่แล้ว

    How to use Selectors when using RTK query and with arguments

  • @woolygan1529
    @woolygan1529 ปีที่แล้ว

    Nice tutorial

  • @mujahidansorimajid1524
    @mujahidansorimajid1524 8 หลายเดือนก่อน

    is there any video explain about mutation

  • @junior.antunes
    @junior.antunes 10 หลายเดือนก่อน

    Thanks a lot. You just make it very easy to understand.
    If I could give x1000 likes, I would do it
    Great video!!!!!

  • @alirabiei2344
    @alirabiei2344 ปีที่แล้ว

    11:27
    so if I have 100 api endpoints I should wrap 100 providers?! 🤔

  • @prashantindurkar
    @prashantindurkar ปีที่แล้ว

    Thanks

  • @suryateja2524
    @suryateja2524 ปีที่แล้ว

    Please do the video on react native and ionic + react

  • @akhilchandra5935
    @akhilchandra5935 ปีที่แล้ว +2

    Thanks!

  • @oncoding4520
    @oncoding4520 ปีที่แล้ว +2

    Is this video on the 9h React that you uploaded yesterday> ? Thank you

  • @exkoi
    @exkoi ปีที่แล้ว

    thank you

  • @jhjhzjhfjvhzxjchjhxhjc
    @jhjhzjhfjvhzxjchjhxhjc ปีที่แล้ว +1

    way to 100k

  • @avishkadevinda6097
    @avishkadevinda6097 ปีที่แล้ว

    Please make a video about redux-thunk

  • @jehnzcode
    @jehnzcode 5 หลายเดือนก่อน

    I got an error it says: "Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup."

  • @takek7739
    @takek7739 ปีที่แล้ว +1

    Pedro can you make a video on usecontext hook and how it used in authentication

    • @johnadepelumi93
      @johnadepelumi93 ปีที่แล้ว

      I think he has something on using context api
      check here: th-cam.com/video/LlvBzyy-558/w-d-xo.html

  • @raulygo6709
    @raulygo6709 ปีที่แล้ว

    How to create an search engine with Redux and createApi?

  • @sebastianmihaiprisacariu8975
    @sebastianmihaiprisacariu8975 ปีที่แล้ว +2

    Can you do a video on the T3 stack and tRPC? Id really appreciate it.

  • @rotocub6963
    @rotocub6963 ปีที่แล้ว

    How to make isLoading take longer?

  • @user-qe6fg5nu1d
    @user-qe6fg5nu1d ปีที่แล้ว

    store ekada vaadinav bro?

  • @coffee0919
    @coffee0919 ปีที่แล้ว

    ApiProvider can't use with Provider!!!

  • @mosesukwenya5605
    @mosesukwenya5605 ปีที่แล้ว

    First to like:-)

  • @oscarrojas3968
    @oscarrojas3968 10 หลายเดือนก่อน

    Does anyone know of testing this components ?

  • @waleedsharif618
    @waleedsharif618 ปีที่แล้ว

    Is this better than normal fetch ?

  • @Blenberg
    @Blenberg ปีที่แล้ว +1

    Hi Pedro.
    Thanks for tutorials.
    What's the difference between React Query fetching and Redux toolkit fetching?

    • @PedroTechnologies
      @PedroTechnologies  ปีที่แล้ว +2

      Two different tools to achieve the same thing. I would chose react query if I am not using redux and RTK query when I am. Both are good!

  • @user-nb4tw1ju6u
    @user-nb4tw1ju6u 5 หลายเดือนก่อน +1

    11:46
    If there are more than one Api slice I would like my component to acess? How do I add multiple apis in API provider

    • @isha25tripathi12
      @isha25tripathi12 4 หลายเดือนก่อน

      hey let me know if you found the answer , I am not adding it in the API Provider as I have the normal provider but I also wanted to know how to handle multiple slices

    • @GamerSharp
      @GamerSharp วันที่ผ่านมา

      @@user-nb4tw1ju6u
      @isha25tripathi12
      There you go!
      store.js file:
      import { configureStore } from "@reduxjs/toolkit";
      // Redux Toolkit: slices
      import counterReducer from "./counterSlice";
      // RKT Query: slices
      import { profileApi } from "./profileQuery";
      import { timezoneApi } from "./timezoneQuery";
      const store = configureStore({
      reducer: {
      counter: counterReducer,
      [profileApi.reducerPath]: profileApi.reducer,
      [timezoneApi.reducerPath]: timezoneApi.reducer,
      },
      middleware: (getDefaultMiddleware) =>
      getDefaultMiddleware().concat(profileApi.middleware, timezoneApi.middleware),
      });
      export default store;
      __________________________
      import { Provider } from "react-redux";
      import store from "../redux/store";
      function App({ Component, pageProps }) {
      return (

      (here your app)

      );
      }
      export default App;

  • @shahlakamal1120
    @shahlakamal1120 ปีที่แล้ว

    Can I use RTK query with firebase?

    • @lopghkt
      @lopghkt ปีที่แล้ว

      i think u can, just rly dont know how, i tried today and i could register an user, but couldnt get the user curr state

  • @kdot78
    @kdot78 ปีที่แล้ว +2

    First

  • @sameerdewan881
    @sameerdewan881 ปีที่แล้ว +22

    Boss, you're not supposed to use both a Provider and ApiProvider.

    • @Pharizer
      @Pharizer ปีที่แล้ว

      I was thinking the same

    • @coffee0919
      @coffee0919 ปีที่แล้ว

      yep

    • @dawnishere775
      @dawnishere775 ปีที่แล้ว +1

      exactly!!
      ApiProvider should only be used when we're not using any store for our APP 😒

    • @waltergermanes4528
      @waltergermanes4528 ปีที่แล้ว

      where should it be?

    • @chrisstucker1813
      @chrisstucker1813 8 หลายเดือนก่อน +1

      Yeah if you’re not using a redux store then api provider is fine. But if you are using redux store then add the apislice to the store and no need to also provide an api provider

  • @shineLouisShine
    @shineLouisShine 5 หลายเดือนก่อน

    07:05 - "Right?"
    Mmm...
    I don't know anything about it.
    But you can always not take for granted that everyone knows what you're talking about, and teach us... Right?

  • @alfonsopayra
    @alfonsopayra ปีที่แล้ว

    are you Spanish speaker?

  • @AwkwardFX
    @AwkwardFX ปีที่แล้ว +1

    Terrible tutorial

  • @Pareshbpatel
    @Pareshbpatel ปีที่แล้ว

    Excellent tutorial on Redux Toolkit Query. Thanks, Pedro.
    {2022-12-12}