React Router 6 - Tutorial for Beginners

Поделиться
HTML-код
  • Опубликовано: 13 июл 2024
  • Learn how to use React Router V6 in this crash course for beginners. React Router is the most popular way to add page routing in React Apps. It is used very frequently in React projects.
    ✏️ John Smilga from Coding Addict created this course. Check out his channel: / @codingaddict
    💻 Source Code: github.com/john-smilga/react-...
    🔗 React Tutorial: • React Course - Beginne...
    🔗 React Projects: • Code 15 React Projects...
    ⭐️ Course Contents ⭐️
    ⌨️ (0:00:00) First Pages
    ⌨️ (0:11:01) Page Components
    ⌨️ (0:15:47) Link Component
    ⌨️ (0:19:39) Error Page
    ⌨️ (0:22:39) Navbar
    ⌨️ (0:24:39) Nested Routes
    ⌨️ (0:29:39) Shared Layout
    ⌨️ (0:35:58) Index Pages
    ⌨️ (0:41:43) NavLink Component
    ⌨️ (0:49:02) URL Params
    ⌨️ (0:55:56) Single Product
    ⌨️ (1:01:36) useNavigate()
    ⌨️ (1:09:49) Protected Route
    ⌨️ (1:13:52) Refactor
    🎉 Thanks to our Champion and Sponsor supporters:
    👾 Raymond Odero
    👾 Agustín Kussrow
    👾 aldo ferretti
    👾 Otis Morgan
    👾 DeezMaster
    --
    Learn to code for free and get a developer job: www.freecodecamp.org
    Read hundreds of articles on programming: freecodecamp.org/news

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

  • @eacardenase
    @eacardenase 2 года назад +127

    John is so good at teaching! Thanks to him I landed my first job as web developer! :3

  • @tanaydwivedi2922
    @tanaydwivedi2922 2 года назад +14

    Best react router v6 explanation that i had ever found on internet. Binged watch this whole video and it was absolutely worth it. Thank you John for making react router v6 easier.

  • @remitto8367
    @remitto8367 2 года назад +1

    I took some time away from React, came back, and was having tons of problems with the new React Router 6. Following this tutorial fixed everything, thanks so much.

  • @Sports-Made
    @Sports-Made Год назад

    I watched lots of videos, but whenever I watch John’s videos things are so much clearer…. Thank you for all the time you have put into these videos… Will definitely send a big one to you….

  • @BlastbeaterPT
    @BlastbeaterPT 2 года назад

    This is the best React Router course i have witness. Very concise and straightforward :)

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

    Absolutely one of (if the not the best) I have viewed! Thank you.

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

    Amazing job! Thank you so much for this awesome content. Props to John for teaching this topic. I appreciate your effort.

  • @mohitsaud2071
    @mohitsaud2071 2 года назад +5

    Love you John ❤. One of the biggest reasons that I have started working as node.js developer is you John ❤.

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

    Great tutorial! Thanks for teaching react router v6 so clearly!

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

    Awesome tutorial. Most courses are yet to adopt to React Router V6. Thank you, John.

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

    Thank you for your work. Awesome explanation of each detail !

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

    Perfect explanation pace! Thank you John!

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

    Amazing tutorial! Exellent work, guys!

  • @fedu_sampa
    @fedu_sampa 2 года назад +1

    Another project from John. Thanks man.

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

    So simplified, thanks for the great tutorial❤️

  • @eliarece-5996
    @eliarece-5996 2 года назад +4

    You published this the day after I learn React Router 6...

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

    Thank you so much john for this amazing tutorial !

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

    Best explanation about react router I saw, thank you for this John !

  • @python-programming
    @python-programming 2 года назад +3

    Looking forward to this tutorial!

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

    This is very well taught. Thanks for making it very clear.

  • @riteshmauryafullstackdevel3753
    @riteshmauryafullstackdevel3753 2 года назад +2

    always waiting for video 💗💗💯

  • @elamandeep
    @elamandeep 2 года назад +2

    Thank you John for awesome tutorial

  • @yimiesart9262
    @yimiesart9262 2 года назад

    Thank you so much, John Smilga!

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

    The course is awesome! 🔥

  • @eyujunior9991
    @eyujunior9991 2 года назад +3

    I was going to learn this tomorrow morning and somehow youtube recommended it to me🤩🤩🤩

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

    I'd have given this multiple likes if it was possible. Top work John.

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

    宝藏博主!我挖到宝了,好清晰的教学呀,爱了爱了🥰

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

    Thanks a lot John.
    I'll be so glad if you release a NextJs course

  • @aiFeeling
    @aiFeeling 2 года назад +2

    Wow. Its great one .❤️

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

    John Smilga does it all... with STYLE! =)

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

    This is a great resource. Wow! thank you

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

    Thanks man you re the best teacher i ve ever had

  • @rightsonkirigha9669
    @rightsonkirigha9669 2 года назад

    Finally, the video i have waiting for

  • @chibuzorobiefuna9586
    @chibuzorobiefuna9586 2 года назад +4

    Great piece watching from Nigeria 🥰🥰👍👍

  • @medzikuser
    @medzikuser 2 года назад +3

    Thanks for video!

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

    this tutorial is very concise, tk u teacher!

  • @yulyasaroyan8696
    @yulyasaroyan8696 2 года назад

    OMG guys this is sooo nice, thanks to this channel

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

    I just got the explanation. Thanks 😊

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

    Just awesome!

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

    The Simplicity is Amazing

  • @AlexandruBejenari
    @AlexandruBejenari 2 года назад +2

    Thanks for video!!!

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

    thank you so much for video tutorial , it really helps me to understand react router dom v6 )))

  • @RN-hq8gg
    @RN-hq8gg 5 месяцев назад

    simple and great tutorial

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

    Perfect, thanks;)

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

    Thank you I learned a lot, you helped me a lot. Godbless Sir and the free Code Camp

  • @INAVACL
    @INAVACL 2 года назад +1

    Thank you so much, this solved two issues ive been having. I feel dumb lol

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

    Thankyou for sharing the knowledge.👍👍

  • @chimdimgbeokwere2415
    @chimdimgbeokwere2415 2 года назад

    Amazing content!

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

    Just amazing

  • @IamCkNitin
    @IamCkNitin 2 года назад +2

    Excellent

  • @jorgenUA
    @jorgenUA 2 года назад +1

    finally a good teacher,

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

    thank uo so much

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

    Done and Dusted. React Router V6 understood !! Roger that sargent

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

    This is a very very good video!

  • @tarunsikarwar
    @tarunsikarwar 2 года назад +6

    Please make a full course on typescript beginners to advance level

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

    Great!

  • @mahdiouatah761
    @mahdiouatah761 2 года назад

    Thank you so helpful

  • @FiveFourThor
    @FiveFourThor 2 года назад

    That voice .. I can recognize it anywhere! hahah. Awesome video!!

  • @wxIyz
    @wxIyz 2 года назад

    With subtitles, Thank you FreeCodeCamp

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

    John f. DOE! Cant miss you teaching code.

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

    such a great content leave more ducking likes

  • @jaloliddinhaqnazarov2667
    @jaloliddinhaqnazarov2667 2 года назад +2

    Very good 👍👍👍👍

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

    thank you

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

    Awesome tutorial! Noob question. Once on the single product page, how would one button click through all the available products? Would that be slider functionality or still routes?

  • @saplay3372
    @saplay3372 2 года назад

    Thanks this

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

    Pretty good tutorial!
    Also, I have discovered, several voices in English make me fall asleep, I don't know why, I've found a few channels that produce that effect on me :|

  • @westernpigeon
    @westernpigeon 2 года назад

    FINALLYYYY

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

    i was at the 8 minutes mark then i got engrossed in the potential masterpiece i could make and started dancing and bobbinb my head

  • @sharathnair2790
    @sharathnair2790 2 года назад +3

    Every v6 tutorial is lacking the searchParams part of it. I feel that is the most important part. There are only few tutorials on that

  • @shivamrana5984
    @shivamrana5984 2 года назад

    Today I am struggling with routers and then I found this

  • @prakharmj
    @prakharmj 2 года назад +1

    Hey is the on refresh action giving error because the user request is sent to the backend handled here?

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

    For some reason on the home page/shared layout page I can't use any of the navigation links I can't click any of them and their styles on active and hover don't seem to be applied. If I open up the dom though I can access them by just clicking and if I go to one of the nested pages. the navigation seems to wrok again

  • @jitendramistry1241
    @jitendramistry1241 2 года назад +1

    Angular tutorials❤❤❤ please🤩??

  • @heavilgaming4763
    @heavilgaming4763 2 года назад +1

    Please post a nuxt js course ...plsssss 🙏

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

    If you are finding your NavLink component is always highlighting 'home' as well as the current page, you can fix this by putting 'end' on the end of your Home NavLink opening tag.
    i.e. (isActive ? "link nav-link-active": "link")} to="/" end>Home

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

    El Reacto of the JavaScript Cartel

  • @mrrishiraj88
    @mrrishiraj88 2 года назад

    👍

  • @yoismak
    @yoismak 2 года назад

    hey, cool video!
    Im new to react and got a little confused... can we simply not use NextJS for this? It comes with other features too

    • @Steel0079
      @Steel0079 2 года назад

      React is where you start before learning Nextjs.

  • @azubuikenjoku712
    @azubuikenjoku712 2 года назад

    Please what if the data is coming from a server? How do I pass it from Products page to product page?

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

    How does he iterate over the object at 59:00 min? I got an error that " map is not a function"😕😔

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

    Hi John, I really appreciate the way you teach, but I think you are not showing us the real webpage that is the product of the code on the left side, Pay attention to @10:26 "Testing" in the browser and "testing" in the code, how come this be so?

  • @KrishnaKumar-qx1mk
    @KrishnaKumar-qx1mk Год назад

    when we change the url after login , since he is a user he must be able to navigate to other pages , how can i achive this feature?

  • @johngeronimo8821
    @johngeronimo8821 2 года назад

    48:16 May I know why you have "link active" instead of "active" in the first condition of your classname?

    • @christopherpink842
      @christopherpink842 2 года назад

      i had to watch over a few times to know, so "active" is default styling provided by react-router, so when you want to style it yourself with custom colours your can create a class name in your css and name it whatever you want , he just named it link and added it to active, thats why he wrote "link active"

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

    sotis when the sample finishes playing it will play over itself and you get tNice tutorials echo effect.

  • @thegullvlog1551
    @thegullvlog1551 2 года назад +1

    can someone explain to me
    if i learned React Router V6 why would i need to learn Next.js ? Can someone tell me the difference?? i never dove deep into Next.js so i dont know if there is a secret trick Next does im just wondering

    • @demawobass
      @demawobass 2 года назад +1

      what you do with React to configuring your own routes , with nextjs , it does that for you out of the box, nested routes might be tricky with React router but nextjs You can just put those in a folder and use index.js as the parent

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

    React Router updated their lib

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

    44:05 for some strange reason my Home Link is always keeping the active class.... cant figure out why

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

      Found the solution actually in the React Documentation, maybe it has changed since you've been recording this. You just have to add the word "end" just before you close the opening NavLink Tag like so:
      This way it will work

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

      @@martapfahl940 Thanks

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

    Mind grenade
    - John Smilga

  • @leonzeng4139
    @leonzeng4139 9 месяцев назад

    how to create the initial project and how to run it? I clone the github but I can't run it.
    I tried npm start, but it shows:
    'react-scripts' is not recognized as an internal or external command,
    operable program or batch file

  • @ericcartman2294
    @ericcartman2294 2 года назад +1

    Barak Obama teaches React Router.

  • @aiFeeling
    @aiFeeling 2 года назад

    Can you give me something like spotify with flutter?

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

    The image links to cloudinary in data.js does not work anymore :/

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

      Now they work again :)

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

    😃 I have just completed this tutorial and now i confidently say that i know react-router-dom uses.. Thanku john smilga and whole FreeecodeCamp team...

  • @wishmeheaven
    @wishmeheaven 9 месяцев назад

    Hey John, v6.4 changed the rules

  • @chubbyBunny94
    @chubbyBunny94 2 года назад +1

    Can someone please summon me or when there's a tutorial for Redux without TypeScript

  • @EhteshamShahzad
    @EhteshamShahzad 2 года назад +2

    React Router tutorial: switch to NextJS.

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

    TypeError: setUser is not a function
    Error in Login.js in string - setUser({ name: name, email: email });
    Can anybody help me? Maybe someone stuck on this too.

  • @willi3.mp4
    @willi3.mp4 2 года назад

    How can the title be changed?

  • @argumentchannel
    @argumentchannel 2 года назад

    link #page single page?

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

    really good content, but too much back and forth on the md file