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

  • @DennisIvy
    @DennisIvy Жыл бұрын

    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

    @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!

  • @ambrosearuwa9458
    @ambrosearuwa94582 жыл бұрын

    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

    @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.

  • @southofsleep
    @southofsleep Жыл бұрын

    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! :)

  • @appuser
    @appuser Жыл бұрын

    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.

  • @efeamioku3220
    @efeamioku32202 жыл бұрын

    Implemented this for login using Local Storage and it works like magic. Thanks so much, You are my React Protected Route Hero.

  • @sasidharn323
    @sasidharn323 Жыл бұрын

    Very valuable information explained in a short video, thank you so much Dennis.

  • @swapnilcodes
    @swapnilcodes Жыл бұрын

    One of the best videos on Protected Routes in React Ever ! Loved it !

  • @semico-l-on
    @semico-l-on4 ай бұрын

    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

    @pranjulkushwaha8345

    4 ай бұрын

    Same with me

  • @anubhavgupta7155
    @anubhavgupta71552 жыл бұрын

    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

  • @shabalins
    @shabalins2 жыл бұрын

    Great video on this topic! Relevant, clear and helpful. Thanks a lot!

  • @petarkolev6928
    @petarkolev6928 Жыл бұрын

    Thanks for the awesome video, Dennis! It was really a time saver

  • @ivancastillo161
    @ivancastillo1615 ай бұрын

    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 ^_^

  • @jhonesjhonatas5524
    @jhonesjhonatas55247 ай бұрын

    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.

  • @toppmoviehighlights
    @toppmoviehighlights2 жыл бұрын

    Great, video. Direct , incisive and practical.

  • @learningnoobi2156
    @learningnoobi21562 жыл бұрын

    This is really my favourite feature of the new version . I am using this everytime

  • @user-py2vo1gz4t
    @user-py2vo1gz4t11 ай бұрын

    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 :)

  • @mullaarbazzz
    @mullaarbazzz5 ай бұрын

    You are life saver man. so on to the point and short and simple video. hatsss off to you

  • @farnazzinnah8541
    @farnazzinnah8541 Жыл бұрын

    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

  • @Ali-Iybar
    @Ali-Iybar Жыл бұрын

    Thank you for this short and focused video.

  • @borgestheborg
    @borgestheborg2 жыл бұрын

    This video couldn't have come at a better time for me!

  • @benjaminkhoury304
    @benjaminkhoury304 Жыл бұрын

    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!

  • @GMCorner
    @GMCorner Жыл бұрын

    I was looking for this for so long. Thank you for the video

  • @teksaiyanhere
    @teksaiyanhere Жыл бұрын

    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 :)

  • @Crossalter
    @Crossalter Жыл бұрын

    Finally a video make sense! Thanks man, its help me so much to continue lerning about this.

  • @ahsanahsan1087
    @ahsanahsan108711 ай бұрын

    Thank you for taking up this we want more videos like this really good bro

  • @smarq86
    @smarq86 Жыл бұрын

    Thank you! Great explanation. Was helpful in my React app!

  • @chiho8119
    @chiho8119 Жыл бұрын

    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.

  • @OscrGarcia
    @OscrGarcia Жыл бұрын

    Thank you so much for explaining this, I was finally able to make it work!

  • @Lotpite
    @Lotpite Жыл бұрын

    Really thank you for this information, really simple and useful explanataion!!!

  • @Smarteez83
    @Smarteez83 Жыл бұрын

    So much time saved with this video ! Per-fect !

  • @haseebalam9174
    @haseebalam91745 ай бұрын

    This video helped me a lot as I was building a MERN Stack application

  • @harshasrisameera8164
    @harshasrisameera8164 Жыл бұрын

    Life saver, It worked without a blink thank you so much

  • @ignaciofreitas8183
    @ignaciofreitas8183 Жыл бұрын

    Bro you rock! Thank you so much for avoiding me some headaches :)

  • @TheOnkard
    @TheOnkard2 жыл бұрын

    Loving React content from you sire 👑

  • @PaulAilincai
    @PaulAilincai8 ай бұрын

    This video helped me fix my UX and consequently improve security on my product

  • @fortniteplaystation9050
    @fortniteplaystation905010 ай бұрын

    Really looking for a video like this , thanks a lot

  • @alex_law_codes
    @alex_law_codes5 ай бұрын

    Thanks this was a really clean video!

  • @entertechinc
    @entertechinc Жыл бұрын

    Great video Dennis. Thank you

  • @HimanshuSharma-pz9gv
    @HimanshuSharma-pz9gv Жыл бұрын

    hey dennis you just saved my big project , Kudos : )

  • @jaguilar718
    @jaguilar718 Жыл бұрын

    Very straightforward, thank you!!!

  • @bingewatcher144
    @bingewatcher144 Жыл бұрын

    This is the only yt video in which the Outlet is perfectly explained❤❤

  • @FGA-47
    @FGA-47 Жыл бұрын

    Thanks Dennis that was really helpful.

  • @rohit87k
    @rohit87k Жыл бұрын

    Thank you so much - you saved mine lots of time ✅

  • @muhammad_abir
    @muhammad_abir2 жыл бұрын

    thanks a lot dennis..... I was very confused until watch this video

  • @yannickdurden
    @yannickdurden8 ай бұрын

    Straightforward, thanks for the video 👌

  • @akomaningemmanuelsunday8424
    @akomaningemmanuelsunday8424 Жыл бұрын

    Sir Dennis, all I can say is God richly bless you, sir Thank you

  • @Txushin
    @Txushin Жыл бұрын

    Awesome video, really clear, thanks!

  • @devlifeaz
    @devlifeazАй бұрын

    So good for me. Thank you man! You are really hero :)

  • @XXlikeabauss
    @XXlikeabauss11 ай бұрын

    Really good video, thanks Dennis

  • @sushantabhowmick1031
    @sushantabhowmick1031 Жыл бұрын

    Love you man , Osm explanation with your documentation

  • @tayyabhaseeb8866
    @tayyabhaseeb886610 ай бұрын

    Amazing video invaluable and straightforward ❤

  • @martincho111986
    @martincho1119862 жыл бұрын

    thank you very much!! this was very useful, you explanation was very great and understandable!!, comparin with others videos, so thanks again

  • @sirjschool7926
    @sirjschool7926 Жыл бұрын

    This helped me out a lot!!

  • @ValeryTeramin
    @ValeryTeramin5 ай бұрын

    Thank you, it is exactly what I was looking for

  • @FilipeFernandes-ic3os
    @FilipeFernandes-ic3os Жыл бұрын

    Perfect! Thanks a lot for the explanation!

  • @hypermeero4782
    @hypermeero47822 жыл бұрын

    man, you saved me. THANK YOU!

  • @fellypsantos_
    @fellypsantos_ Жыл бұрын

    Thanks friend! Helped a lot !! :D

  • @Septumsempra8818
    @Septumsempra8818 Жыл бұрын

    You just saved me from hours of banging my head on the desk and questioning the futility of my dreams.

  • @mikhailsmirnov8539
    @mikhailsmirnov8539 Жыл бұрын

    That's great, thanks a lot! This was a life saver really!

  • @natcoziay
    @natcoziay Жыл бұрын

    Thank you SOOOOOOOOOO Much! This was a life saver! Wish I could give you a hundred more likes.

  • @TheJenasandeep
    @TheJenasandeep Жыл бұрын

    Great Explanation!

  • @unyuzimfuraishimwejoykevin4812
    @unyuzimfuraishimwejoykevin4812 Жыл бұрын

    Quick video, Self-Explanatory, Made me hit the Subscribe button 😁😁

  • @hilkiahlavinier
    @hilkiahlavinier Жыл бұрын

    Thanks much!! Just what I was looking for

  • @mubashir2859
    @mubashir2859 Жыл бұрын

    Thanks for quick help

  • @xtremewolve
    @xtremewolve Жыл бұрын

    Wow, awesome explaination

  • @ElrondMcBong86
    @ElrondMcBong862 жыл бұрын

    Awesome! quick and clear! :-)

  • @juanchoprogramacion
    @juanchoprogramacion Жыл бұрын

    Thank you, great work!

  • @hamzaali228
    @hamzaali228 Жыл бұрын

    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

  • @mathewsaraujo2293
    @mathewsaraujo2293 Жыл бұрын

    Thanks, this video helped me a lot!

  • @KKYT-fc3bu
    @KKYT-fc3bu5 ай бұрын

    Thank you so much. without any doubt i fully understand it and it did really work.

  • @matheuscarvalho87
    @matheuscarvalho872 жыл бұрын

    You saved my life!! Thanks a lot!!!

  • @farhadmirzaei8960
    @farhadmirzaei8960 Жыл бұрын

    Great Video , Thanks man

  • @JumaInTech
    @JumaInTech Жыл бұрын

    exactly what I need ed mahn. Thanks a lot😀

  • @nicksonpinto2074
    @nicksonpinto20749 ай бұрын

    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)

  • @masudranahimu3783
    @masudranahimu3783 Жыл бұрын

    really good and informative video

  • @hasanmahmood2001
    @hasanmahmood2001 Жыл бұрын

    Very well explained!!!

  • @DCMPSaliva
    @DCMPSaliva2 жыл бұрын

    You change lives dude

  • @bryang3044
    @bryang3044 Жыл бұрын

    Very, very, nice video. Thank you.

  • @IzharJumadi
    @IzharJumadi Жыл бұрын

    awesome video, thanks for sharing!

  • @alexeyshaykov
    @alexeyshaykov Жыл бұрын

    Thanks a lot. U save my day!

  • @HarishGGU
    @HarishGGU Жыл бұрын

    very helpful video. thanks so much.

  • @crissatrapi3933
    @crissatrapi393311 ай бұрын

    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

  • @harekrishna4584
    @harekrishna45842 ай бұрын

    i dont why this channel is so underated omgggg!!! this guy is awesome

  • @DennisIvy

    @DennisIvy

    2 ай бұрын

    ☺️

  • @_MoshikoAz_
    @_MoshikoAz_ Жыл бұрын

    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

  • @nikhil8krishnan
    @nikhil8krishnan8 ай бұрын

    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

  • @saulbenavides4037
    @saulbenavides40372 жыл бұрын

    Thanks for sharing!

  • @truecallerbackup8392
    @truecallerbackup83922 жыл бұрын

    Thanks for informative video I'm understood everything is about auth thanks

  • @voducthang16
    @voducthang162 жыл бұрын

    Nice video!!! Thank you

  • @speedofbytes
    @speedofbytes Жыл бұрын

    Very cool man, interesting, used this logic in a app of mine

  • @dr.slasher5346
    @dr.slasher5346 Жыл бұрын

    great one keep it up!

  • @malingasarmandocumbane2300
    @malingasarmandocumbane2300 Жыл бұрын

    Perfect, this is amazing.

  • @aripovjr
    @aripovjr Жыл бұрын

    Thank you Dennis

  • @d0gl0gic80
    @d0gl0gic80 Жыл бұрын

    This is fantastic thank you

  • @vikasni95
    @vikasni95 Жыл бұрын

    Wow great explanation tquu😊

  • @sarfaraz6582
    @sarfaraz6582 Жыл бұрын

    Woow this is good i was actually rendering every component based on user authentication which is pretty inconvenient way

  • @Kv2.6
    @Kv2.64 ай бұрын

    Thank you brother!!!

  • @hajamohiyadeen4741
    @hajamohiyadeen4741Ай бұрын

    Thanks, it's very helpful

  • @guillermoquiros2402
    @guillermoquiros24022 жыл бұрын

    Thanks, great video

  • @erfanattarzadeh4357
    @erfanattarzadeh43572 жыл бұрын

    You saved my life. Thanks

  • @suzonahmmed5736
    @suzonahmmed5736 Жыл бұрын

    You are the Boss. Thanks a lot! 😘😘👍👍

Келесі