The New Way To Create Protected Routes With React Router V6
Ойын-сауық
Updated version of how to create protected routes in react router v6.
Check out the article that goes with this: / 2c4bbaf7bc1c
Source code: github.com/divanov11/React-ro...
Follow me on twitter: / dennisivy11
Пікірлер: 222
New video implements this same strategy but with a full backend that handles Sign-in, Logout, and registration here: kzread.info/dash/bejne/onuC2tGCn6_aj7w.html
@joaoarthurbandeira
Жыл бұрын
Hey Dennis! First of all, thanks a lot for all the great stuff! Could u do an up-to-date video using React + DRF and how to implement the authentication/register/login with JWT? Maybe a project? Cheers, man!
God bless you @Dennis Ivy I was following your JWT tutorial and got frustrated when you got to the private route part and I spent the entire day on stackoverflow browsing for solutions but found nothing🤣🤣🤣 until I came back to KZread and searched for "private route" and this video was one of the first that popped up. Thanks
@edwinowino4018
Жыл бұрын
This is a life saver, I was also following the JWT tutorial and I have been stuck on private routes the whole day until i found this.
Invaluable and straightforward. Like many, I had some older V5 router code that was passing all the components for auth testing into a helper function like this and just couldn't get my head around. Thanks Dennis! :)
Thank you, this was doing my head in. If anyone working on the React Router project sees this, please provide a couple more examples in the docos (could even link to this video if still best practice). There's also scant examples of the redirect _function_ which you can return/throw from loaders, which I suspect replaces or compliments the workflow in this video.
Implemented this for login using Local Storage and it works like magic. Thanks so much, You are my React Protected Route Hero.
Very valuable information explained in a short video, thank you so much Dennis.
One of the best videos on Protected Routes in React Ever ! Loved it !
Thankyou Dennis. I've been stuck for 3 days implementing protected routes. Watched many videos but it was all complicated. But yours got me through!
@pranjulkushwaha8345
4 ай бұрын
Same with me
Thank You!! I wasn't upgrading my React version because there was not yet a tutorial about React router v6 😂. Now I can happily work on projects with the new version
Great video on this topic! Relevant, clear and helpful. Thanks a lot!
Thanks for the awesome video, Dennis! It was really a time saver
Thank you so much! Videos with the old outdated router versions are a dime-a-dozen. Couldn't find many other videos that actually explain the new method ^_^
Very good! good teaching, and the fact that I had the github repository helped me a lot, in a few minutes I was able to implement it in my application! Thanks for the content.
Great, video. Direct , incisive and practical.
This is really my favourite feature of the new version . I am using this everytime
thanks for sharing. Just a couple suggestions, you may also want to include dynamic routes(such as id's), and GuestRoutes to redirect the user to home if they are already logged in. But good tutorial with outlet. We used it where I worked at to stack routes and it worked great :)
You are life saver man. so on to the point and short and simple video. hatsss off to you
Thanks man!! Imma subscribe you. I have been trying to fix this issue for last 3 days and I finally did it with your help. Really appreciate it! Keep up the good work and keep on helping programmers out
Thank you for this short and focused video.
This video couldn't have come at a better time for me!
Thanks a lot was looking around for a couple of hours on how to do this, solved the problem I had with this video and a bit of tinkering!
I was looking for this for so long. Thank you for the video
Thanks a lot man you made my day, i got stuck with this issue for a whole day and this video just fixed it, Thanks a lot mate :)
Finally a video make sense! Thanks man, its help me so much to continue lerning about this.
Thank you for taking up this we want more videos like this really good bro
Thank you! Great explanation. Was helpful in my React app!
I was looking for a simple but reliable solution, but this is good to go. Maybe I want to use something like a map function which loops through the object of routes with the responding path names and so on. But need to figure out how, but this solution helps me a lot.
Thank you so much for explaining this, I was finally able to make it work!
Really thank you for this information, really simple and useful explanataion!!!
So much time saved with this video ! Per-fect !
This video helped me a lot as I was building a MERN Stack application
Life saver, It worked without a blink thank you so much
Bro you rock! Thank you so much for avoiding me some headaches :)
Loving React content from you sire 👑
This video helped me fix my UX and consequently improve security on my product
Really looking for a video like this , thanks a lot
Thanks this was a really clean video!
Great video Dennis. Thank you
hey dennis you just saved my big project , Kudos : )
Very straightforward, thank you!!!
This is the only yt video in which the Outlet is perfectly explained❤❤
Thanks Dennis that was really helpful.
Thank you so much - you saved mine lots of time ✅
thanks a lot dennis..... I was very confused until watch this video
Straightforward, thanks for the video 👌
Sir Dennis, all I can say is God richly bless you, sir Thank you
Awesome video, really clear, thanks!
So good for me. Thank you man! You are really hero :)
Really good video, thanks Dennis
Love you man , Osm explanation with your documentation
Amazing video invaluable and straightforward ❤
thank you very much!! this was very useful, you explanation was very great and understandable!!, comparin with others videos, so thanks again
This helped me out a lot!!
Thank you, it is exactly what I was looking for
Perfect! Thanks a lot for the explanation!
man, you saved me. THANK YOU!
Thanks friend! Helped a lot !! :D
You just saved me from hours of banging my head on the desk and questioning the futility of my dreams.
That's great, thanks a lot! This was a life saver really!
Thank you SOOOOOOOOOO Much! This was a life saver! Wish I could give you a hundred more likes.
Great Explanation!
Quick video, Self-Explanatory, Made me hit the Subscribe button 😁😁
Thanks much!! Just what I was looking for
Thanks for quick help
Wow, awesome explaination
Awesome! quick and clear! :-)
Thank you, great work!
I have a question. without token strored in the localstorage the user is unable to navigate to dashboard and othe protected routes and that's perfectly fine but the issue i face is that when user logged in the token stored in the localstorage the user also navigate to / route which in my case is a login page route so i want to protect it like in such a way that if token then user will be unable navigate to login page
Thanks, this video helped me a lot!
Thank you so much. without any doubt i fully understand it and it did really work.
You saved my life!! Thanks a lot!!!
Great Video , Thanks man
exactly what I need ed mahn. Thanks a lot😀
How would you do this for server sessions where we get session from backend like an API. Won't it render login then go to that home?(assuming auth API call is made inside useEffect)
really good and informative video
Very well explained!!!
You change lives dude
Very, very, nice video. Thank you.
awesome video, thanks for sharing!
Thanks a lot. U save my day!
very helpful video. thanks so much.
Thanks!!! this was a very good explanation for beginners like me ☺. However I couldn't manage to do the opposite (block the login and signup page when logged in). I'm going to read more info about it
i dont why this channel is so underated omgggg!!! this guy is awesome
@DennisIvy
2 ай бұрын
☺️
thank you for the video, i have a question tho, how would you recommend to store the token, to maximize the security in the app ? assuming i already have a backend to handle the token for me
can we navigate from auth pages to home if user entered in to the specific pages directly without using useEffects, because its not good adding same useEffect navigate conditions in multiple pages @dennis
Thanks for sharing!
Thanks for informative video I'm understood everything is about auth thanks
Nice video!!! Thank you
Very cool man, interesting, used this logic in a app of mine
great one keep it up!
Perfect, this is amazing.
Thank you Dennis
This is fantastic thank you
Wow great explanation tquu😊
Woow this is good i was actually rendering every component based on user authentication which is pretty inconvenient way
Thank you brother!!!
Thanks, it's very helpful
Thanks, great video
You saved my life. Thanks
You are the Boss. Thanks a lot! 😘😘👍👍