React Router 6 - Tutorial for Beginners

  Рет қаралды 156,528

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

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 жыл бұрын
John is so good at teaching! Thanks to him I landed my first job as web developer! :3
@Steel0079
@Steel0079 2 жыл бұрын
Same here 😊
@danilkrymskiy3431
@danilkrymskiy3431 2 жыл бұрын
Wow, congrats!
@toppmoviehighlights
@toppmoviehighlights 2 жыл бұрын
I totally agree.... and congratulations, man.
@aldimilano4516
@aldimilano4516 Жыл бұрын
Good to hear that, congratulations.
@jacksonson1593
@jacksonson1593 Жыл бұрын
Can you share how can I connect with you?
@tanaydwivedi2922
@tanaydwivedi2922 2 жыл бұрын
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 жыл бұрын
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 Жыл бұрын
This is the best React Router course i have witness. Very concise and straightforward :)
@mohitsaud2071
@mohitsaud2071 2 жыл бұрын
Love you John ❤. One of the biggest reasons that I have started working as node.js developer is you John ❤.
@eliarece-5996
@eliarece-5996 2 жыл бұрын
You published this the day after I learn React Router 6...
@peterpardo4138
@peterpardo4138 Жыл бұрын
Amazing job! Thank you so much for this awesome content. Props to John for teaching this topic. I appreciate your effort.
@donramsey8119
@donramsey8119 Жыл бұрын
Absolutely one of (if the not the best) I have viewed! Thank you.
@chadrogers5743
@chadrogers5743 Жыл бұрын
Great tutorial! Thanks for teaching react router v6 so clearly!
@adebayoayo5898
@adebayoayo5898 Жыл бұрын
So simplified, thanks for the great tutorial❤️
@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 !
@python-programming
@python-programming 2 жыл бұрын
Looking forward to this tutorial!
@eyujunior9991
@eyujunior9991 2 жыл бұрын
I was going to learn this tomorrow morning and somehow youtube recommended it to me🤩🤩🤩
@martapfahl940
@martapfahl940 Жыл бұрын
Perfect explanation pace! Thank you John!
@mathewdavies1480
@mathewdavies1480 Жыл бұрын
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
@joshualord986
@joshualord986 Жыл бұрын
Thanks!
@onkillstreak2106
@onkillstreak2106 Жыл бұрын
saved my day. I was trying to debug this
@amitsaha642
@amitsaha642 Жыл бұрын
Thanks a lot man
@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 !
@jamesonajobi3135
@jamesonajobi3135 Жыл бұрын
The Simplicity is Amazing
@charlesxstorm
@charlesxstorm Жыл бұрын
This is very well taught. Thanks for making it very clear.
@fedu_sampa
@fedu_sampa 2 жыл бұрын
Another project from John. Thanks man.
@elamandeep
@elamandeep 2 жыл бұрын
Thank you John for awesome tutorial
@yimiesart9262
@yimiesart9262 Жыл бұрын
Thank you so much, John Smilga!
@chinonsoojoechem1462
@chinonsoojoechem1462 Жыл бұрын
Thanks a lot John. I'll be so glad if you release a NextJs course
@vitaly_p
@vitaly_p Жыл бұрын
Amazing tutorial! Exellent work, guys!
@ayi8603
@ayi8603 Жыл бұрын
宝藏博主!我挖到宝了,好清晰的教学呀,爱了爱了🥰
@Mozatron87
@Mozatron87 Жыл бұрын
I'd have given this multiple likes if it was possible. Top work John.
@CoderDmitri
@CoderDmitri Жыл бұрын
John Smilga does it all... with STYLE! =)
@Javous12345
@Javous12345 Жыл бұрын
Thanks man you re the best teacher i ve ever had
@florenciobritez5521
@florenciobritez5521 Жыл бұрын
The course is awesome! 🔥
@chibuzorobiefuna9586
@chibuzorobiefuna9586 2 жыл бұрын
Great piece watching from Nigeria 🥰🥰👍👍
@INAVACL
@INAVACL 2 жыл бұрын
Thank you so much, this solved two issues ive been having. I feel dumb lol
@riteshmauryafullstackdevel3753
@riteshmauryafullstackdevel3753 2 жыл бұрын
always waiting for video 💗💗💯
@dreamerwandering
@dreamerwandering Жыл бұрын
this tutorial is very concise, tk u teacher!
@rightsonkirigha9669
@rightsonkirigha9669 2 жыл бұрын
Finally, the video i have waiting for
@kennedychukwu4152
@kennedychukwu4152 Жыл бұрын
This is a great resource. Wow! thank you
@yulyasaroyan8696
@yulyasaroyan8696 2 жыл бұрын
OMG guys this is sooo nice, thanks to this channel
@tarunsikarwar
@tarunsikarwar 2 жыл бұрын
Please make a full course on typescript beginners to advance level
@boluwatifejanet3162
@boluwatifejanet3162 Жыл бұрын
I just got the explanation. Thanks 😊
@nodiraegamberdiyeva5581
@nodiraegamberdiyeva5581 Жыл бұрын
thank you so much for video tutorial , it really helps me to understand react router dom v6 )))
@jorgenUA
@jorgenUA 2 жыл бұрын
finally a good teacher,
@aiFeeling
@aiFeeling 2 жыл бұрын
Wow. Its great one .❤️
@miketepes8208
@miketepes8208 Жыл бұрын
Thank you I learned a lot, you helped me a lot. Godbless Sir and the free Code Camp
@medzikuser
@medzikuser 2 жыл бұрын
Thanks for video!
@Sovit705
@Sovit705 Жыл бұрын
Thankyou for sharing the knowledge.👍👍
@AlexandruBejenari
@AlexandruBejenari 2 жыл бұрын
Thanks for video!!!
@RN-hq8gg
@RN-hq8gg 4 ай бұрын
simple and great tutorial
@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?
@FiveFourThor
@FiveFourThor 2 жыл бұрын
That voice .. I can recognize it anywhere! hahah. Awesome video!!
@wxIyz
@wxIyz 2 жыл бұрын
With subtitles, Thank you FreeCodeCamp
@silviualexandruparaschiv9838
@silviualexandruparaschiv9838 Жыл бұрын
Just awesome!
@nischaljadhav8395
@nischaljadhav8395 Жыл бұрын
Done and Dusted. React Router V6 understood !! Roger that sargent
@chimdimgbeokwere2415
@chimdimgbeokwere2415 Жыл бұрын
Amazing content!
@junsgk
@junsgk Жыл бұрын
John f. DOE! Cant miss you teaching code.
@Amanidridi457
@Amanidridi457 Жыл бұрын
thank uo so much
@mahdiouatah761
@mahdiouatah761 Жыл бұрын
Thank you so helpful
@voice_famous_books4301
@voice_famous_books4301 6 ай бұрын
Perfect, thanks;)
@jandeswart1378
@jandeswart1378 Жыл бұрын
This is a very very good video!
@IamCkNitin
@IamCkNitin 2 жыл бұрын
Excellent
@danialez
@danialez 5 ай бұрын
Just amazing
@prakharmj
@prakharmj 2 жыл бұрын
Hey is the on refresh action giving error because the user request is sent to the backend handled here?
@JeyDotC
@JeyDotC Жыл бұрын
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 :|
@inaamkhan7886
@inaamkhan7886 10 ай бұрын
I also have the same problem .
@sharathnair2790
@sharathnair2790 2 жыл бұрын
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
@abhishekkumarsingh2387
@abhishekkumarsingh2387 Жыл бұрын
Scrimba has included searchParam in detail .
@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
@shivamrana5984
@shivamrana5984 2 жыл бұрын
Today I am struggling with routers and then I found this
@RiteshNEVERUNIFORM
@RiteshNEVERUNIFORM Жыл бұрын
Great!
@jaloliddinhaqnazarov2667
@jaloliddinhaqnazarov2667 2 жыл бұрын
Very good 👍👍👍👍
@nikwotten1804
@nikwotten1804 Жыл бұрын
such a great content leave more ducking likes
@darismathewrivalx5862
@darismathewrivalx5862 Жыл бұрын
thank you
@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
@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?
@saplay3372
@saplay3372 2 жыл бұрын
Thanks this
@azubuikenjoku712
@azubuikenjoku712 2 жыл бұрын
Please what if the data is coming from a server? How do I pass it from Products page to product page?
@westernpigeon
@westernpigeon 2 жыл бұрын
FINALLYYYY
@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 6 ай бұрын
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?
@jitendramistry1241
@jitendramistry1241 2 жыл бұрын
Angular tutorials❤❤❤ please🤩??
@heavilgaming4763
@heavilgaming4763 2 жыл бұрын
Please post a nuxt js course ...plsssss 🙏
@thegullvlog1551
@thegullvlog1551 2 жыл бұрын
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 жыл бұрын
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
@badboys7656
@badboys7656 Жыл бұрын
sotis when the sample finishes playing it will play over itself and you get tNice tutorials echo effect.
@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 Жыл бұрын
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"
@leonzeng4139
@leonzeng4139 8 ай бұрын
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
@leonzeng4139
@leonzeng4139 8 ай бұрын
Thanks,I got it.
@returnMarcco
@returnMarcco Жыл бұрын
El Reacto of the JavaScript Cartel
@martapfahl940
@martapfahl940 Жыл бұрын
44:05 for some strange reason my Home Link is always keeping the active class.... cant figure out why
@martapfahl940
@martapfahl940 Жыл бұрын
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
@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.
@aiFeeling
@aiFeeling 2 жыл бұрын
Can you give me something like spotify with flutter?
@mrrishiraj88
@mrrishiraj88 2 жыл бұрын
👍
@patt4343
@patt4343 6 ай бұрын
The image links to cloudinary in data.js does not work anymore :/
@patt4343
@patt4343 6 ай бұрын
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...
@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.
@calvinwilliams729
@calvinwilliams729 Жыл бұрын
React Router updated their lib
@briandacallos4234
@briandacallos4234 Жыл бұрын
Mind grenade - John Smilga
@argumentchannel
@argumentchannel 2 жыл бұрын
link #page single page?
@shineLouisShine
@shineLouisShine 6 ай бұрын
So unfortunately,this tutorial doesn't seems to include the option to register/sign up from within the login form as a reasonable common requested and legit possibility..? Thanks anyway.
@chubbyBunny94
@chubbyBunny94 2 жыл бұрын
Can someone please summon me or when there's a tutorial for Redux without TypeScript
@willi3.mp4
@willi3.mp4 2 жыл бұрын
How can the title be changed?
@EhteshamShahzad
@EhteshamShahzad 2 жыл бұрын
React Router tutorial: switch to NextJS.
@wishmeheaven
@wishmeheaven 8 ай бұрын
Hey John, v6.4 changed the rules
@bishalmahanta1765
@bishalmahanta1765 Жыл бұрын
49:05
React State Management - Intermediate JavaScript Course
2:46:38
freeCodeCamp.org
Рет қаралды 238 М.
React Router - Complete Tutorial
23:53
Cosden Solutions
Рет қаралды 77 М.
Which one is the best? #katebrush #shorts
00:12
Kate Brush
Рет қаралды 13 МЛН
Backstage 🤫 tutorial #elsarca #tiktok
00:13
Elsa Arca
Рет қаралды 28 МЛН
Learn React Router v6 In 45 Minutes
46:20
Web Dev Simplified
Рет қаралды 525 М.
React Router Crash Course
38:56
freeCodeCamp.org
Рет қаралды 115 М.
Natural Language Processing with spaCy & Python - Course for Beginners
3:02:33
Micro-Frontends Course - Beginner to Expert
1:56:44
freeCodeCamp.org
Рет қаралды 381 М.
Redux Toolkit Tutorial - JavaScript State Management Library
1:50:42
freeCodeCamp.org
Рет қаралды 239 М.
React router crash course
55:54
Hitesh Choudhary
Рет қаралды 29 М.
How To Create A Navbar In React With Routing
19:16
Web Dev Simplified
Рет қаралды 365 М.
React Tutorial for Beginners
1:20:04
Programming with Mosh
Рет қаралды 2,6 МЛН
I Made 200 Python Projects...Here Are My 5 FAVORITES
11:23
Tech With Tim
Рет қаралды 132 М.
Which one is the best? #katebrush #shorts
00:12
Kate Brush
Рет қаралды 13 МЛН