React Router V6.4+ Tutorial - New Syntax, useLoaderData...

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 121

  • @PedroTechnologies
    @PedroTechnologies  Год назад +10

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

    • @hariprasad4917
      @hariprasad4917 Год назад

      please do video on redux saga with redux toolkit and perform CRUD operation in API please 🥺🥺🥺🥺🥺

    • @iSupportDaThing
      @iSupportDaThing Год назад

      they don't fucking know what to do and need to keep their job so they release useless features every months

  • @SahraClayton
    @SahraClayton Год назад +137

    I really do prefer the older version of React Router, the more simple way of doing things. Since version 6 there has been a big change and I don't like the way we create the router

    • @virtualalphastudios6149
      @virtualalphastudios6149 Год назад +4

      This is for more complex websites, who want to write better, cleaner code and you can still use the old setup in 6.6+

    • @Amvflix7
      @Amvflix7 Год назад +1

      @@virtualalphastudios6149 yeah I'd use the older version for my personal projects

    • @SecretEyeSpot
      @SecretEyeSpot Год назад +7

      You don't have to use an older version. What Pedro is showing is a new feature designed to solve a specific problem. BrowseRouter, Routes, and Router still works the same, but if you have thunks in Redux, or an API to manage and you want components to load irrespective of the store update or the status result of the API this would be a way of circumventing the error boundary preventing the app from compiling

    • @CuriosityCircuit2024
      @CuriosityCircuit2024 Год назад +25

      react-router 7 will change things again, everything that you see here will be obsolete in 6 months.

    • @meditationandrelaxationwit114
      @meditationandrelaxationwit114 Год назад +5

      ​@@CuriosityCircuit2024 true. It becoming burdensome to keep up with technology 😂

  • @aviramWix
    @aviramWix 8 месяцев назад

    03:08 - Defining routes
    12:05 - Data fetching in React
    14:38 - React-router loaders
    20:41 - Loading indication

  • @SecretEyeSpot
    @SecretEyeSpot Год назад +2

    I think this is a very helpful update for programs passing props. As an entry level react front end dev. If im not using typescript, getting an error message that an object isn't defined and needing to go through all the components that manages that prop is so time consuming. It also helps when you don't want to refresh the server but need to make changes that would allow you to see how a resource would be rerendered on the page.

  • @itis-._4me
    @itis-._4me Год назад +1

    I didn't find anyone who knows how to explain more than you..
    you are the best in the world by the way I am Arab and I am learning English from you

  • @jcruz6888
    @jcruz6888 11 месяцев назад

    I find it astounding that web developers successfully went from a simple to whatever this is

  • @thegrizzlywolf5927
    @thegrizzlywolf5927 Год назад +1

    pedro i thank u so much i started with u from zero and now i become an advance in react thank u so much habibi

  • @anton9410
    @anton9410 Год назад +8

    Amazing explanation Pedro, you are literally carrying us on your back. Thank you!

  • @sumitmehra5119
    @sumitmehra5119 Год назад +7

    Older version was quite simple compared to new one

    • @AMBROSEOthniel
      @AMBROSEOthniel 10 месяцев назад +1

      i'm using react router v6 and not 6.4, i'm just new to react, and i just learned v6 , now i'm seeing v6.4

  • @StefanoV827
    @StefanoV827 Год назад +2

    I still prefer using redux toolkit using RTKQuery as a loader for data and handling states. But it's handy i admit it

  • @richa3350
    @richa3350 Год назад

    Was looking for a brief yet useful tutorial on React Router 6 and yours does it amongst all others in youtube! Very well done. Thankyou for providing this!

  • @wishmeheaven
    @wishmeheaven Год назад

    A really good teacher needs - not only a great teaching skill but also THE skill to simplify information... And I really impressed of yours.

  • @אילוןמעיין
    @אילוןמעיין Год назад +1

    You helped me a lot to understand why there is all the change in syntext Thank you very much !

  • @mma-dost
    @mma-dost Год назад +1

    Thanks bro it was super confusing I was reading the docs but some concepts were too confusing. Great thanks

  • @mahirtaz3729
    @mahirtaz3729 Год назад

    amazing pedro. it is really hard to any content of yours where I didn't learn anything new! best wishes keep making us more knowledgeable.

  • @alexanderkomanov4151
    @alexanderkomanov4151 Год назад +1

    Thank you so mach man! I have updated my personal project with the new data loaders according to your explanations - it works perfectly! Solved me a problem with fetching data!

  • @shineLouisShine
    @shineLouisShine Год назад +1

    Thanks. I think that this video should have start with -
    How did you do the element on the screen and its glowing purple/blue effect :)

  • @dankorse
    @dankorse Год назад

    Man, just THANK YOU! I've been trying to understand how to use the React Router using their tutorial on their site. But, few things were just not making sense. Tried a hand full of tutorials here, but none were quite good. Then I thought, I'll see if Pedro has anything on this. And you did have it. You made it SO MUCH easier to understand. PLUS, you also helped with something I wasn't expecting...which is the loaderData.
    I've got a RN app, and am creating a landing page for it. So now, I'll refactor my RN code, so I can use the loaderData, and finish this landing page as well.
    Muito obrigado, mano!

  • @ivanlysko6677
    @ivanlysko6677 7 месяцев назад

    Could you explain how React Router v6.4+ handles dynamic routing and what improvements have been made compared to previous versions?

  • @zakhariihusar6975
    @zakhariihusar6975 Год назад

    Great tutorial! Was a little confused by the new syntax

  • @legendaryfootball4222
    @legendaryfootball4222 Год назад +2

    Hey pedro, can you please make a video on Next.js 13

  • @slyfox1568
    @slyfox1568 Год назад +1

    Thank you so much for this. I was struggling with the new syntax and your explanation was really on point.

  • @thegrizzlywolf5927
    @thegrizzlywolf5927 Год назад +1

    @PedroTech can u please do a course for svelte
    i have question is it good for someone know the react ???

  • @jkpz10
    @jkpz10 Год назад +1

    Hi, beginner question, Just wondering how about doing some rerender on useLoaderData? like in common way we do on useEffect we can add state inside [ ] to listen if something change in your state then execute the fetching again.

  • @JoonasKarp
    @JoonasKarp Год назад +2

    One question: what if there are two dataLoader functions like dataLoader1 and dataLoader2 fetching two different data, how would you add it to loader={} ?

    • @lucaspaixao8107
      @lucaspaixao8107 Год назад +8

      In this case you can create a single function and inside this function, you can use Promise.all envolving the other data fetching functions, and use this function to put it in loader.

  • @monarchgam3r
    @monarchgam3r Год назад +1

    i think this update killed page transitions with framer motion, it's basically impossible now, or am i wrong?

  • @FaridDiraf-l1b
    @FaridDiraf-l1b 5 месяцев назад

    Thanks Pedro, please when you have time make a video on Router with loaders, actions and Firebase Authentication

  • @Gollum69
    @Gollum69 7 месяцев назад

    Hy.
    Can I do a frame with header, footer, and use Roters that only the middle part do refres?
    I hope you understand my basic english.
    Thnak you

  • @christophersasanuma1084
    @christophersasanuma1084 Год назад

    Thanks for the video!! Could you create a video on how to create Protected routes using v6.4 and newer. Thank you!

  • @mma-dost
    @mma-dost Год назад +1

    What a explanation man 🙏🙏👍👍

  • @softwaredeveloper2897
    @softwaredeveloper2897 Год назад

    Thanks Pedro. This is amazing. So imaging having lazy loading, react-query and this 🤯🤯🤯. Happy holidays too

  • @PanlasangMotour
    @PanlasangMotour Год назад +1

    I think this update is good for larger systems that uses more data also upon seeing your tutorials i guess it made easier hehe hope try using this on other tutorials

  • @alisonoz7219
    @alisonoz7219 Год назад

    Thank you for explaining this so well! You are the best!!

  • @m_miko
    @m_miko Год назад +2

    How about defer()

  • @entertainingtennis4594
    @entertainingtennis4594 Год назад

    Ur tutorials are best

  • @ArticulateTheRhytm
    @ArticulateTheRhytm Год назад

    Okay thanks. Could you turn it into a navbar?

  • @huzaifac137
    @huzaifac137 Год назад

    It won't show the children route whanever I visit child root path it still shows the parent route element . It is happening with both the object syntax and jsx syntax. And also naviagtion state is always idle.

  • @sh44ko58
    @sh44ko58 Год назад +1

    Could you please make a new Tutorial about cookie/sessions, and How to use them on different Pages, Like logged on as, etc. 🙏🙏🙏
    Your the best guy about react/node

  • @sylviaboyani1707
    @sylviaboyani1707 Год назад

    Thanks PredroTech for the latest updates and as always your the best.😊

  • @ruona2133
    @ruona2133 Год назад +1

    Hey Pedro, can you please make a video on OTP with react, SQLand node when you forget your password and email verification.

  • @ipreet6850
    @ipreet6850 Год назад

    thanks, its really helpful

  • @datadoesdorian
    @datadoesdorian Год назад

    Thank you for the tutorial. This really helped. I'm not a big fan of this new syntax because it's not as intuitive as the old one. Although I do appreciate the less lines needed

  • @oncoding4520
    @oncoding4520 Год назад

    You are the best love your videos.

  • @Francois3k
    @Francois3k Год назад

    Can make a tutorial with framer motion an how u would configure the routes like how did in the past video it would be helpful

  • @antudey7025
    @antudey7025 Год назад

    This was so informative.

  • @beshoosamy8452
    @beshoosamy8452 Год назад

    Can you make a video about deploying the vite app with react-router-dom 6.6+ to GitHub pages?

  • @arkadiibogdanov5534
    @arkadiibogdanov5534 Год назад

    Pedro, u r awesome!

  • @ulisessauceda3168
    @ulisessauceda3168 Год назад

    i was getting "uncaught runtime error" while working under linux and the troubleshooting stated that i had multiple versions of React-dom installed. I found that i had multiple versions but they all were the same according to npm. I installed everything on my windows 10 side and i used this tuto to find out if Router works. It did.
    How can i fix my problem on my linux side?

  • @Amir_Golmoradi
    @Amir_Golmoradi Год назад

    You're AMAZING BRO🔥🔥 🔥

  • @saifosama1833
    @saifosama1833 Год назад

    its a helpful feature but is this relevent if i'm using RTK query and is the old syntax for react router not valid anymore can i still use it normally ?

  • @giancarlocabrera7336
    @giancarlocabrera7336 Год назад

    Pedro how can i manage url params, i was doing a component which needed an id to render some data, but with the new version i got stuck with it :(

  • @AnhTuanHuynhVan
    @AnhTuanHuynhVan Год назад

    hi want create router modal in v6 but, i can not useLocation() in app.jsx , could you create video to guide, tks you so much

  • @Tester-scratch
    @Tester-scratch 7 месяцев назад

    Why have you attached a MySQL tag to this video? Not a mention of it?

  • @GHOST8799
    @GHOST8799 Год назад

    So react router now does pre-rendering? Nice. Thoughts on tanstack router?

  • @СергейКононенко-б5ы

    Please, make video about JWT key for registration. I didn’t find any good video about this theme. Help me to study it🙏

  • @calvinwilliams729
    @calvinwilliams729 Год назад

    React Router 6.6.3 how do we pass useLocation?
    it now uses createBrowerRouter
    I want to do page transition using framer motion
    but the problem is I dont know where to add the useLocation

  • @wisdomelue
    @wisdomelue Год назад

    thank you✊🏾

  • @muhammed.8853
    @muhammed.8853 Год назад

    Thanks man...much appreciated ☺️👍

  • @alexanderkomanov4151
    @alexanderkomanov4151 Год назад

    Thanks a lot!

  • @vmaldonadojr383
    @vmaldonadojr383 10 месяцев назад

    Make me want to master react instead of staying in basic html and css lol thanks!

  • @jpcc1223
    @jpcc1223 Год назад

    incrível o vídeo, parabéns!

  • @loudsven4056
    @loudsven4056 Год назад

    Can we make post request for second route using form data from first route without UI-state library? Thx

  • @manishrai8292
    @manishrai8292 Год назад

    browserRouter is not workine when i create a build by npm run build to generate an index.html file then i open index.html file in my browser it show a blank page. but when i change browserRouter to hashrouter then it it working fine

  • @nishadvadgama
    @nishadvadgama Год назад

    You have to use new syntax with loaders and bunch of other stuff only If you require to use new Data APIs. Otherwise you can continue using JSX syntax

  • @abrahamjoseph3080
    @abrahamjoseph3080 Год назад +3

    To be honest this new way of routing is super complicated.

  • @wadf29
    @wadf29 Год назад

    Do you still have to use Hashrouter to deploy to github pages?

  • @MohammadSalman-ji6io
    @MohammadSalman-ji6io Год назад

    How can i do AnimatePresence in this new routing script?

  • @mahendranath2504
    @mahendranath2504 Год назад

    Thank you so much

  • @wotizit
    @wotizit Год назад +2

    18:48 annoying bug

  • @Moradelfetni232
    @Moradelfetni232 Год назад

    For the new beginners would you recommend to start with this or no ?

  • @Modernammavan
    @Modernammavan Год назад

    What if we had multiple API calls in a component?

  • @AB-kq9xm
    @AB-kq9xm Год назад

    Does this work on localhost? data isn't fetching for me and this is hard to debug

  • @bestakuma11
    @bestakuma11 Год назад

    pls drop a video on the new react router hooks

  • @Amvflix7
    @Amvflix7 Год назад

    Thanks

  • @avram202
    @avram202 Год назад

    Doesn't react-router-dom offer 'browserRouter, Route, Routes' by default? Thus no need for you to create them, you could use them directly. Why are you creating them manually? There must be a good reason for it, I'm curious what it is if you could explain. Is it just a better practice maybe?

  • @ArticulateTheRhytm
    @ArticulateTheRhytm Год назад

    How to use it together with MUI?

  • @charlesorih6601
    @charlesorih6601 Год назад

    Cool update

  • @gsnowakowski
    @gsnowakowski Год назад

    Can't I use this dataLoader in the old style? At the end its benefit lies in asynchronous call which I can also use in the old ways, can't I?
    I will have to test it now (watching this video in a car.)

    • @gsnowakowski
      @gsnowakowski Год назад

      Yes, it works in the old way using, as you were showing at the beginning useEffect and useState. Thank you anyway for that video.

  • @yadusolparterre
    @yadusolparterre Год назад

    The login pop-up that shows up every 10 seconds is really distracting.

  • @jeklo3713
    @jeklo3713 Год назад

    Wait what should I learned 🤣 should I learn this new or the other one

  • @sirdragoon4625
    @sirdragoon4625 Год назад +2

    Okay they made it more complicated.

  • @noname_160
    @noname_160 Год назад +1

    Bro forgot to cut the mosquito part😂

  • @bestakuma11
    @bestakuma11 Год назад

    nice one

  • @oncoding4520
    @oncoding4520 Год назад

    The video is ok but changing from one IDE to another its a little confusing

  • @mohamedyoussef8835
    @mohamedyoussef8835 Год назад

    Awesome video ++++++++++++++ 🙂

  • @ozoindaprince
    @ozoindaprince Год назад

    I got into react router after the major update and I'll say that the new method is very easy to use and read unlike the scary switch that looks boring in past versions. the object format is very good for me.

  • @hariprasad4917
    @hariprasad4917 Год назад

    Please do redux saga with redux toolkit to fetch api updating editing creating with axios please 🥺

  • @JTSC97
    @JTSC97 Год назад +3

    Great video but these new features just seem like worse, more complex versions of Next 13 features 😅

  • @johan19840
    @johan19840 Год назад

    thanks so much for this video. However. can we agree on something all of us? did you realize what it takes now to just have a fu*** navbar ? :D

  • @datadoesdorian
    @datadoesdorian Год назад

    Really miss the old version. It was a lot easier.

  • @frontend_ko
    @frontend_ko 8 месяцев назад

    hmm

  • @darelbvcr687
    @darelbvcr687 Год назад

    router 6.3 is way easier to setup

  • @AliAhmed-et8gd
    @AliAhmed-et8gd Год назад +2

    Honestly I see it's in most cases a useless update just with complicated syntax

  • @rolfrolfe
    @rolfrolfe Год назад

    Dont like too much , tanstack Is better

  • @chuckynorris616
    @chuckynorris616 Год назад

    the API changes on every version they release LMAO such clowns

  • @Kiev-in-3-days
    @Kiev-in-3-days 11 месяцев назад

    React routing system is really bad. A big rotten ball of random stinky mud made by lazy corporate "devs". Basically pretty much like anything else coming from FB actually. So opinionated in the most evil way. So complex. So limitating. Horrible.

  • @wolfasad9872
    @wolfasad9872 Год назад

    you are too confusing you don't even know things well and push f with annoyed things

  • @nyaaaaaamo
    @nyaaaaaamo Год назад

    better use atomic router instead. react router becomes a trash.

  • @reactmailb6426
    @reactmailb6426 Год назад

    Thanks