React Router - Complete Tutorial

  Рет қаралды 67,246

Cosden Solutions

Cosden Solutions

Күн бұрын

Join The Discord! → discord.cosdensolutions.io
Source Code → github.com/cosdensolutions/co...
VSCode Theme | Font → Material Theme Darker | Menlo, Monaco "monospace"
In this video we will learn about React Router. React Router is a very popular navigation library in React. It allows for a very powerful and robust navigation solution in your React applications. It handle all of the navigation client side, which means that you do not need to reload the browser on every page visit. Everything all happens on the client side. Get ready, because you are going to learn a lot in this video!

Пікірлер: 191
@user-ob9qm4br2j
@user-ob9qm4br2j 3 ай бұрын
My man just explained the whole react-router through a story-like continuous manner
@avrakadavra1552
@avrakadavra1552 3 ай бұрын
Petition to change the title of the video with React Router 6 in a nutshell. Anyway, thank you for this tutorial
@tdematos
@tdematos Ай бұрын
This has to be one of the most high-quality easy-to-understand React Router tutorials on the internet. Good stuff man! 🔥
@damiansimonak7955
@damiansimonak7955 2 ай бұрын
I cant believe. A lot of teachers have 1 hour or almost 4h videos a lot of theory what I didn't understand but now I get that finally. Thank you
@lifeofaimie
@lifeofaimie 3 ай бұрын
This was SO helpful, clear and concise. The perfect intro to React Router!
@VaibhavPrasad
@VaibhavPrasad 16 күн бұрын
Simple, clear, concise and to the point. Brilliant tutorial on v6. 🔥
@Hasaralc
@Hasaralc 3 ай бұрын
this is the most clear lesson about react routers. much love
@thecanadian6145
@thecanadian6145 2 ай бұрын
Youre a great teacher. Showing why you do things instead of just telling is great
@julienheng3880
@julienheng3880 3 ай бұрын
yes! this is what i have been waiting for! thank you so much! another excellent tutorial
@seagull2345
@seagull2345 3 ай бұрын
Love your tutorials brother, very clear and concise.
@g.ryanpeterson9686
@g.ryanpeterson9686 3 ай бұрын
You released this exactly when I needed it.
@chamithperera475
@chamithperera475 2 ай бұрын
Mate, you are gifted at this. Keep on doing what you are doing, you were spot on, on everything. It was well articulated!
@alvinyanson
@alvinyanson 3 ай бұрын
I'm glad I found this channel. I've been using Angular for a quite long time and decided to give React a try and this is definitely my go to channel when learning React. Thank you.
@cosdensolutions
@cosdensolutions 3 ай бұрын
Glad to hear it!
@naziruadam3950
@naziruadam3950 2 ай бұрын
You are an excellent presenter and explainer. I had to watch this video a couple of times to pick up your styles.😁
@checker4174
@checker4174 16 күн бұрын
Your explanations are fantastic! you make the concepts so accessible and easy to follow
@brajagopal4725
@brajagopal4725 3 ай бұрын
Direct on-point tutorial. Just love it❤
@iranna9065
@iranna9065 3 ай бұрын
It was much needed. The best video on React router 6
@user-og5rw1nk7d
@user-og5rw1nk7d 2 ай бұрын
Whenever i want to understand any react topic i just want to watch your video bcs you explain in very simple manner🔥🔥
@ichiroutakashima4503
@ichiroutakashima4503 2 ай бұрын
I'll be honest here, I haven't really touched React and React Router for quite a while because I was busy with WebGL and R3F and threeJS so I've become rusty, but thanks to your videos I honestly got speed up to date despite documentations existing. This is easier to digest and read compared to their docs imo. Definitely worth a subscribe!
@afokerealityigho9003
@afokerealityigho9003 Ай бұрын
their doc is simply a no no no i was reading their doc but nahh it's was just confusing that's why i came here i actually prefer docs over videos. I only watch videos after finishing doc or when the doc is too confusing the tutorial is really nice God bless him
@ujjwal4441
@ujjwal4441 24 күн бұрын
amazing tutorial! explaned everything in almost 20mins.
@shubhamtarade
@shubhamtarade 3 ай бұрын
Much needed tutorial to learn react router v6, thanks!!!
@alanford9260
@alanford9260 3 ай бұрын
What a great job you did, bro! Thanks a lot for such a great video!
2 ай бұрын
you re a shining diamond on React field. thank you for amazing contents.
@rahulpatil3942
@rahulpatil3942 2 ай бұрын
This is a great and easy to follow introduction to react-router
@richiezo
@richiezo 19 күн бұрын
I love the way you explained it. 🤗🤭
@ajlebeau
@ajlebeau Ай бұрын
Your explanations are incredible! Thank you!
@jakobjaworski9526
@jakobjaworski9526 Ай бұрын
This saved me hours of work, you know. Thank you Sir.
@vikashgupta3305
@vikashgupta3305 3 ай бұрын
great Explanation in flow, each concept was connected to previous concept....We want one more video on React-Router 2
@nikawuladze953
@nikawuladze953 Ай бұрын
probably best channel I have ever watched
@runelillevang1011
@runelillevang1011 3 ай бұрын
Best explanation i have found, it really helps you explain every step in detail!
@ahmedfernandez4695
@ahmedfernandez4695 13 күн бұрын
Thanks for the cristal clear explanation. Literally save me hours 💪🏽🔥
@mercyiskey9009
@mercyiskey9009 3 ай бұрын
I understood everything you explained. Thank you!
@ernestadonu9110
@ernestadonu9110 Ай бұрын
This is awesome the one of the best I have seen so far
@rivvychica
@rivvychica 3 ай бұрын
THANK YOU for this video, and I love the way you teach. I sometimes struggle with React Router even though it seems so simple in theory. Finally it just really clicked with me, and I am now subscribed!
@cosdensolutions
@cosdensolutions 3 ай бұрын
glad it was helpful!
@alminyana0
@alminyana0 2 ай бұрын
Hi Cosden, grate video as usual. many thanks, mate
@johnacsyen
@johnacsyen 2 ай бұрын
Very concise tutorial. Thanks for your effort in making this.
@angelogaspar364
@angelogaspar364 2 ай бұрын
Great content ! Direct to the point. Thank you
@manojpatra4458
@manojpatra4458 24 күн бұрын
Thanks. You explained it nicely.
@rjwhite4424
@rjwhite4424 3 ай бұрын
wasn't a COMPLETE tutorial but definitely taught me some new stuff. Good video!
@devdeclan
@devdeclan 3 ай бұрын
I might do a vid like this, thanks for the inspo
@rjwhite4424
@rjwhite4424 3 ай бұрын
if you do include how loaders and defer works. I've been trying to figure that out for weeks. @@devdeclan
@moschg78
@moschg78 3 ай бұрын
Great tutorial, thank you man!
@tomas6909
@tomas6909 2 ай бұрын
Great work with this tutorial!! Greetings from Argentina
@stroutco2070
@stroutco2070 13 күн бұрын
Solid video 👌🏻 Will def recommend
@becharaalhosri6471
@becharaalhosri6471 3 ай бұрын
Awesome tutorial man, I hope if I keep learning and watching your videos I can get a job as a react developer.
@mDHARYL
@mDHARYL 3 ай бұрын
Of course you will learn it by doing
@thomasimbriago8257
@thomasimbriago8257 Ай бұрын
Extremly helpful video, thanks!
@DominatesYT
@DominatesYT 2 ай бұрын
Amazing amazing video and explanation! Thank you!
@hitendrapatil9991
@hitendrapatil9991 3 ай бұрын
Awesome bro. Your are vdo's are very knowledgeableand anyone can understand easily. 🙏
@RabeaerisFracto
@RabeaerisFracto Ай бұрын
Thanks a lot, i really needed this. So helpful, i really needed this. Suscribed!
@ChristopherNolanski
@ChristopherNolanski 18 күн бұрын
Sir, I forsee a magnificent future for this channel. Concise, to the point, very articulate, you remind me to another great teacher of initials 'TNN'. You are the kind of creator that makes most bootcamps look like rubish😎. May I dream with a future Angular course? Just let me dream . Keep it up! 🤠
@user-wr5bs5yg4i
@user-wr5bs5yg4i 3 ай бұрын
Great and simple explanation!
@Sofien_Steve
@Sofien_Steve 2 ай бұрын
maybe change the channel's name to React Made Simple, what a clear explanation 👏👏
@youcancallmejoker340
@youcancallmejoker340 20 күн бұрын
Cheers. Amazing video!
@LGelashvili
@LGelashvili 3 ай бұрын
Your videos are awesome, bro.
@user-zt4cm5zx5k
@user-zt4cm5zx5k 4 күн бұрын
very useful and easy to perceive, ty
@chowiee5688
@chowiee5688 20 күн бұрын
Thanks Man, I learn a lot from you nice one😎😎
@annyotamo
@annyotamo 3 ай бұрын
Once I watch your tutorial I never have to worry about forgetting the topic. Your explanations are the best. Please could you bring a typescript with react tutorial please!
@cosdensolutions
@cosdensolutions 3 ай бұрын
It's coming Friday ☺️
@Nashoflow95
@Nashoflow95 2 ай бұрын
Que buen video bro! te ganaste un suscriptor
@nextleveltech267
@nextleveltech267 Ай бұрын
Sir.... It was really useful content... Literally............. Your explanation was good... Love you sooo much.............❤️❤️❤️❤️❤️❤️
@Abken.
@Abken. 2 ай бұрын
Great video! I'm glad that RRv6 finally started getting more coverage lately, especially with the addition of Data APIs (loader). I would be curious to hear your opinion on the loader Data API in general, so I'm looking forward to a potential future video :D What do you think about the Data APIs in RRv6 in projects where there's already state management (e.g. RTK)? Do you feel that it gets kind of "confused" in the paradigm (declarative TS with React vs declarative React only) in your opinion or you see it as a viable synergy between RTK Query (or tanstack react query) and RRv6 Data APIs for example? I definitely see a little paradigm confusion + not enough TS support in RRv6's Data APIs, but it can also be a cool synergy for sure with RTK's caching in a project that already uses Redux (or tanstack otherwise). Maybe it needs a little bit more time to fully settle down... A "quick" example of a working project with deferred loader (RRv6 Data API) using RTKQ and TypeScript: // loaders export const itemsLoader = (() => defer({ dataAsync: store.dispatch(api.endpoints.getItems.initiate()).unwrap() })) satisfies LoaderFunction; // using npm i react-router-typesafe for type inferrence for the useLoaderData, error hooks and RRv6 Await component in React 18 Suspense, etc. // router ; export const Items = () => { const { dataAsync: itemsLoaderAsync } = useLoaderData(); // Note: it will be strongly typed based on the loader automatically return ( {/* Note: items will be strongly typed automatically to the type coming from the query in the loader, e.g. Array */} {(items) => items.map((item) => {item.description})} ); }; export const ItemsLoading = () => Loading items...; export const ItemsErrorBoundary = () => { const routeLoaderError = useRouteError() as FetchBaseQueryError; const isValidError = isRouteErrorResponse(routeLoaderError) || isFetchQueryError(routeLoaderError); return ( {isValidError && routeLoaderError.status === 'FETCH_ERROR' && Error: Connection to API failed} {isValidError && routeLoaderError.status === 400 && Error: Bad Request} {isValidError && routeLoaderError.status === 404 && Error: 404 Not found} ); }; export const isFetchQueryError = (error: unknown): error is FetchBaseQueryError => isObject(error) && 'status' in error; // the end All of this could have been done with just the RTKQ's useQuery hook that already has {data, loading, error} and split into the 3 components directly inside without React Router at all, but then with this approach we can throw errors in the loader or in the component and they will bubble up eventually to the RRv6's route's errorElement which is much safer and can be used like old-school error boundaries from OOP React + the Await component also has an errorElement prop that can utilize the same but for example with an optional boolean `fromItemsComponent` prop and render even more personalized errors inside the error boundary vs the more generic fallback when bubbled up to the route's errorElement while using the same component which again reuses the idea of error boundary from OOP React but in a much more powerful way (also as a functional component), so I see a lot of benefit in RRv6 Data API vs simply RTKQ or tanstack react query. I think it's quite cool to be able to use the best out of both worlds - modern State Management hooks (e.g. rtk caching and ability to write automated queries or manual async thunks /e.g. for tokens/) and React Router 6 Data API hooks when state management is not needed in the respective component. Both state management like RTKQ and RRv6 Data Loaders already allow us to ditch useEffects for fetching which is a huge step forward to what we had years ago, but I'm curious to see where the whole RRv6 Data API combined with modern state management redux/rtk/saga/tanstack/zustand will go and if one or the other will become obsolete entirely or many projects will find the more verbose synergy between the two still useful going forward with React 19 and potentially after improving the TS support on RRv6 Data API (since even with custom typesafe enhanced hooks it's not fun, e.g. RRv6's class DeferredData in LoaderData is still not exported and unusable as a type). Great times to be a TS frontend dev for sure. Looking forward to React's ecosystem in 2025 for sure, haven't given up on it yet
@artistnahiart3728
@artistnahiart3728 Ай бұрын
Just want to say thanks. exact exact exact which I wanted
@omidgreat
@omidgreat 3 ай бұрын
Thank you so much brother ❤😊 please more videos like this 😅
@suprabhatkumar5478
@suprabhatkumar5478 Ай бұрын
Thanks for this great video. Please consider adding Forms, loaders, actions as well.
@ayushyapatel8645
@ayushyapatel8645 3 ай бұрын
Hey bro just to let you know your knowledge game me more understanding than other courses i took . just so grateful . Also wondering if you can make a video about api integration in nex tJs
@lamarkkhalifa3970
@lamarkkhalifa3970 2 ай бұрын
dude you are such a life saver !!!!!!!!
@uvins
@uvins 23 күн бұрын
Very thank you, this is the only working way!!!
@republicoftutorials6068
@republicoftutorials6068 2 ай бұрын
Great explanation thank you
@mohamedsalimbensalem6118
@mohamedsalimbensalem6118 3 ай бұрын
Ive watched all your videos and i learned alot thanks to you I suggest if u make a video about virtualization using package and then doing it from scratch
@shwetamane8774
@shwetamane8774 2 ай бұрын
Great tutorial 👏
@alem182
@alem182 2 ай бұрын
Great video!! thanks!
@n241195r
@n241195r 28 күн бұрын
Great vid!
@abhitrana3425
@abhitrana3425 2 ай бұрын
Very good tutorial!!!
@USPSLaura
@USPSLaura Ай бұрын
great teacher 🧑‍🏫
@okpechisblog2385
@okpechisblog2385 26 күн бұрын
This is a great way to get started with react router though with the constant update on react i feel youll need to do an update course soon. good job
@zamanEhsani
@zamanEhsani 3 ай бұрын
nice and easy explanation.
@Host-Tach
@Host-Tach 27 күн бұрын
Hello! Thank you very much for the video! Please tell me what library you use to use css at 8:55. please share your library. Sorry for my possibly strange English. I translated from Russian using a translator.
@INetreba
@INetreba 2 ай бұрын
good clear lesson
@sylvestercampbell7892
@sylvestercampbell7892 3 ай бұрын
Great fan of you👍
@muhammadmursalin8915
@muhammadmursalin8915 2 ай бұрын
Great work.🎂🎂😀
@muhammadshefain6073
@muhammadshefain6073 27 күн бұрын
Awesome tutorials
@user-jz8wx9op8j
@user-jz8wx9op8j 2 ай бұрын
I love this guy
@lukalastname8199
@lukalastname8199 24 күн бұрын
im too lazy to understand from docs, it was helpful and fast haha
@tofidndndkkdkwkqe7017
@tofidndndkkdkwkqe7017 2 ай бұрын
Thx bro!!
@victorm3807
@victorm3807 3 ай бұрын
I really like your videos I follow you from Rwanda 🇷🇼, you explain topics very professional. We would highly appreciate that you can make a full React course that covers all the topics you gave us in the React roadmap!! Thanks and keep it up we like you!!
@cosdensolutions
@cosdensolutions 3 ай бұрын
the course is currently being worked on!
@no-distrx
@no-distrx 21 күн бұрын
Thank you)
@gagikyeranosyan
@gagikyeranosyan Ай бұрын
Thanks!
@ahmadnku8336
@ahmadnku8336 3 ай бұрын
Exactly, On time
@joyustcian222
@joyustcian222 2 ай бұрын
perfect one
@dimitmoto1716
@dimitmoto1716 3 ай бұрын
Thanks a lot! Btw I have watched your redux tutorial and for async state you use async thunks. In real life do you use async thunks or redux toolkit query or something else? What do you prefer?
@cosdensolutions
@cosdensolutions 3 ай бұрын
I usually use React Query nowadays the most! It does a lot of what I want automatically in terms of async functions. For other state. I'll use zustand or redux, depending on the project
@dimitmoto1716
@dimitmoto1716 3 ай бұрын
@@cosdensolutions Thanks for the reply. I'd ask you RTK query tutorial, but if it's not the best solution, I don't know if it will make sense.
@cosdensolutions
@cosdensolutions 3 ай бұрын
it's a great solution, I just don't always need redux so I use RQ instead. All solutions are great and it ultimately depends on the project
@dimitmoto1716
@dimitmoto1716 3 ай бұрын
@@cosdensolutions thank you!
@stevenwoolston8620
@stevenwoolston8620 2 ай бұрын
Any chance we can see the package.json so we know the npm package versions you’re using?
@proostdaantv
@proostdaantv 18 күн бұрын
Great tutorial! However, i'm running into an issue; I have a Navbar and Footer component that's outside of the createBrowserRouter array, which breaks the application. I can't imagine I need to add the navbar and footer with every page/component, so how do I go about it? Thank you!
@colorblack8305
@colorblack8305 3 ай бұрын
keep making *more stuff* man, yeah docs have more in-depth explanations but it's simply not viable for one to go through every doc just to use/learn some features, there's just too many things to learn & cover. More content would be helpful as it's like outsourcing the learning. And thanks your contents have been very helpful.
@LieseLu
@LieseLu 15 күн бұрын
Thank you a million times! Your video is so clear that I could just use react-router-dom in my project too! But I have problem of setting default page "/city" rather than "/", I checked severl methods like add index: true, use Navigate to redirect, , and set the basename as the documention said, but none of them worked, I used Browser router at last...
@Mohammed-rx6ok
@Mohammed-rx6ok 2 ай бұрын
Magnificent
@GiantSquid13
@GiantSquid13 Ай бұрын
Hi, Thanks for taking time to make such awesome tutorials. I always enjoy watching and learning from them. I am totally new to react router dom and using the was amazing as I have a static headers and footers and has helped me manage states efficiently. I have a problem though. How do I separate the auth pages/screens from the other screens using this method. Thanks for helping
@RaslenKorbosli
@RaslenKorbosli Ай бұрын
i dont know why i feel scared when i use react router , but after this video im not scared anymore hahahah
@Nika-ql4tm
@Nika-ql4tm 10 күн бұрын
Thanks you this is very helpful! How do i make each profile different like i want each profile to have its own component like profile50.jsx or something like that.
@youssefmagdy7150
@youssefmagdy7150 28 күн бұрын
excellent tutorial thanks a lot if you make a more advanced tutorial it would be very appreciated 🙏
@megafirestar5030
@megafirestar5030 3 ай бұрын
Hello cosden can you do a video for intercepting the back and forward buttons of the browser in react? Please I have been searching for it but couldnt find anything usefull cause all the solutions use useHistory which deprecated
@ndetokiio3563
@ndetokiio3563 2 ай бұрын
thank you
@godofwar8262
@godofwar8262 26 күн бұрын
Does we have to put error page in each object
@michaelrooze278
@michaelrooze278 17 күн бұрын
what version is this? What is the latest version of react-router and react-router-dom?
Server Components in React (Simple Tutorial)
25:27
Cosden Solutions
Рет қаралды 10 М.
How The Web Works - The Big Picture
12:25
Academind
Рет қаралды 493 М.
Glow Stick Secret 😱 #shorts
00:37
Mr DegrEE
Рет қаралды 129 МЛН
Barriga de grávida aconchegante? 🤔💡
00:10
Polar em português
Рет қаралды 68 МЛН
Mini Jelly Cake 🎂
00:50
Mr. Clabik
Рет қаралды 17 МЛН
10. Configuring And Setting Up ESlint
7:17
Imran Codes
Рет қаралды 31
How I Write Clean Code in React
16:36
Cosden Solutions
Рет қаралды 20 М.
Learn React Router v6 In 45 Minutes
46:20
Web Dev Simplified
Рет қаралды 516 М.
Design patterns in React
14:37
Cosden Solutions
Рет қаралды 137 М.
Every CSS Animation property
9:26
chunkydotdev
Рет қаралды 48 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
React Router 6 - базовый роутинг React-приложения
8:06
Михаил Непомнящий
Рет қаралды 193 М.
TanStack Router is my favourite React Router -- TanStack Router Tutorial
39:35
You Need React Query Now More Than Ever
11:04
Theo - t3․gg
Рет қаралды 136 М.
GPT-4o Deep Dive: the AI that CRUSHES everything
28:11
AI Search
Рет қаралды 70 М.
Glow Stick Secret 😱 #shorts
00:37
Mr DegrEE
Рет қаралды 129 МЛН