Full React Tutorial #22 - Exact Match Routes

Sdílet
Vložit
  • čas přidán 13. 01. 2021
  • 🐱‍💻 🐱‍💻 Course Files:
    + github.com/iamshaunjp/Complet...
    🐱‍👤🐱‍👤 JOIN THE GANG -
    / @netninja
    🐱‍💻 🐱‍💻 My Udemy Courses:
    + Modern JavaScript - www.thenetninja.co.uk/udemy/m...
    + Vue JS & Firebase - www.thenetninja.co.uk/udemy/v...
    + D3.js & Firebase - www.thenetninja.co.uk/udemy/d...
    🐱‍💻 🐱‍💻 Helpful Links:
    + HTML & CSS Course - • HTML & CSS Crash Cours...
    + Modern JavaScript course - • Modern JavaScript Tuto...
    + Get VS Code - code.visualstudio.com/
    🐱‍💻 🐱‍💻 Social Links:
    Facebook - / thenetninjauk
    Twitter - / thenetninjauk
    Instagram - / thenetninja

Komentáře • 105

  • @munchybonbon8675
    @munchybonbon8675 Před 2 lety +254

    Just a heads up for other viewers, with React Router v6 (latest version), the code would look like this:





    Basically has been replaced with , and accepts the element attribute, to which you assign the component you would like to load.

    • @bugsyplays3560
      @bugsyplays3560 Před 2 lety +6

      Does this also mean the exact prop isn't needed?
      I'm using 6 and my Create page seemed to work fine without it when done like this.

    • @unknownman1
      @unknownman1 Před 2 lety +3

      @@bugsyplays3560 ARe u sure u are using v6 in your project, as Switch is throwing an error in v6

    • @sabinoramirez2600
      @sabinoramirez2600 Před 2 lety +3

      @@bugsyplays3560 correct

    • @sabinoramirez2600
      @sabinoramirez2600 Před 2 lety +2

      @@unknownman1 bugsy is referring to the 'exact' part of . In v6 it works with just path

    • @susmantobealivebruh4238
      @susmantobealivebruh4238 Před rokem +1

      @@unknownman1 remove "switch" and use "routes "instead of switch then use the code shown as above that should solve that problem

  • @stevegopop
    @stevegopop Před rokem +68

    Bro, this guy has cliff hangers for react tutorials.....I cant stop watching

    • @NetNinja
      @NetNinja  Před rokem +9

      Haha, thanks Steve!

    • @sophiaonyoutube
      @sophiaonyoutube Před měsícem

      who needs netflix when you have netninja on youtube?

    • @cyberohn
      @cyberohn Před měsícem +1

      Honestly broo😂... I came to learn just React router and I find myself watching the whole tutorial 😂

  • @adeleke5140
    @adeleke5140 Před 2 lety +10

    Hi Shaun, it does seem like in Router6, a lot has changed and the path does work automatically

  • @adityaverma6120
    @adityaverma6120 Před 3 lety +19

    Hi Shaun, I think the explanation for partial matching is a bit incorrect at 2:40. /create URL won't match /c route, partial match means partial after every forward slash in the URL. For example, the URL /create/user/123 will match the routes /create or /create/user/, but it won't match any partial word. And this makes more sense because using partial matches, we can nest the routes.

  • @beinyourguard
    @beinyourguard Před 3 lety +9

    Shaun, will you include styled components in this tutorial? I'd love to learn about it.

  • @johnmoore4248
    @johnmoore4248 Před 3 lety +1

    Hi Shawn, I am really excited to see the final product so I am learning a head by studying your github codes up to lesson 32. And again, thank you for creating these educative and informative series. Cheers

  • @infobare2644
    @infobare2644 Před 3 lety

    You are on point, most instructors do not explain what that "exact

  • @carlijn1460
    @carlijn1460 Před 3 lety

    thank you so much for this video! I am new to react and i had some trouble with routes, but you explained it so well in this video and it helped a lot! Keep up the good work!

  • @sadev0
    @sadev0 Před 3 lety +13

    Hey Shawn thanks for this :)...
    Is there any chance of Coming "Testing React - Typescript with JEST || ENZYME " Course?

  • @kashmirtechtv2948
    @kashmirtechtv2948 Před 2 lety

    Amazing!! You clear the things in a very short time

  • @wontontech
    @wontontech Před 10 měsíci +1

    This is excellent, short and to the point! Thank you

    • @NetNinja
      @NetNinja  Před 10 měsíci +1

      Thanks, hope you enjoyed it!

  • @gracelee5182
    @gracelee5182 Před 3 lety

    if the Switch tag renders the route component exclusively, why do we need the exact property in the first place? I'm confused.

  • @ReachByteBurst
    @ReachByteBurst Před rokem +1

    congrats on a mil, thanks for the content!

  • @zakariabhaibi
    @zakariabhaibi Před rokem +1

    If you are working with V6 you also do not need to use the exact in the Route declaration.

  • @spookimiiki5891
    @spookimiiki5891 Před 3 lety

    Very good video! Straight to the point!

  • @amjadiqbalkhanniazi
    @amjadiqbalkhanniazi Před 3 lety +1

    great tutorials, thanks, it will be good if you include context api in this tutorial with useReducer hook

  • @oscardbg9654
    @oscardbg9654 Před 3 lety +1

    Ninjas, how can i deploy locally the app if i'm using webpack, i've tried the vscode live server and express server for the index.html but didn't work...

  • @indianlongboarder2844
    @indianlongboarder2844 Před 3 lety

    i finally learned the use of exact thank you

  • @mohamedmousa2777
    @mohamedmousa2777 Před 3 lety +2

    Always the best instructor

  • @rohitdummu7526
    @rohitdummu7526 Před rokem +2

    Thank you so much you have cleared all my doubts🥳

  • @Yasmine_habun
    @Yasmine_habun Před rokem

    Thanks a lot for everything literally. THANKS

  • @anthonycalo4047
    @anthonycalo4047 Před 2 lety +2

    You the man! Thanks for the videos. Every other react router video is unclear or some guy from India

  • @sertacekici3342
    @sertacekici3342 Před 3 lety

    This is amazing. Good job as always. Thank you Shaun

  • @nandopookey9195
    @nandopookey9195 Před rokem

    Thankyou very much sir

  • @johnconnor9787
    @johnconnor9787 Před 3 lety +2

    Please, consider someday to make a playlist on MERN stack

  • @forresthu6204
    @forresthu6204 Před rokem +1

    Thanks

  • @pranavmishra9366
    @pranavmishra9366 Před 2 lety

    Thanks buddy, I implemented and it worked.

  • @jess140
    @jess140 Před 3 lety

    great video!

  • @theobellash6440
    @theobellash6440 Před rokem

    What about lazy loading a component?

  • @alexstaresson9517
    @alexstaresson9517 Před 3 lety

    nice stuff!

  • @joelmurphy7702
    @joelmurphy7702 Před rokem +1

    In addition to @munchyBonbon 's comment, remember to define an 'element' attribute if you're using v6 of react-router-dom:

  • @ghofranedarragi5601
    @ghofranedarragi5601 Před 2 lety

    thank you very much

  • @rownokmahbub
    @rownokmahbub Před 2 lety

    'useEffect' is defined but never used how could i Solve this error? anyone please help me?

  • @bharathr5936
    @bharathr5936 Před 3 lety

    Thank you

  • @kashmirtechtv2948
    @kashmirtechtv2948 Před 2 lety

    It looks for the first address
    It finds / so it shows homepage that's why we use exact

  • @mkmalikcom
    @mkmalikcom Před 3 lety

    thank-you ♥️

  • @renzjorgesjaredsanfernando3441

    THANK YOU SO MUCHHHHH

  • @mohamedhourri5607
    @mohamedhourri5607 Před 3 lety

    i love u man !!

  • @hasanalkhder6260
    @hasanalkhder6260 Před 2 lety

    Great tutorial's

  • @basilm.b8499
    @basilm.b8499 Před 5 měsíci

    In recent versions of react-router-dom, the Switch component has been replaced by Routes
    function App() {
    return (










    );
    }

  • @scanpower8439
    @scanpower8439 Před rokem

    I need to sleep and chill WHY AM I SO ADDICTED TO THIS xD

  • @clarencelindh1178
    @clarencelindh1178 Před 2 lety

    gz to 800k

  • @naolchala4354
    @naolchala4354 Před 3 lety

    Good tutorial, can you add à video with router animation?

  • @wpxpert98
    @wpxpert98 Před rokem

    great! thank you

    • @NetNinja
      @NetNinja  Před rokem

      No worries! thanks for watching :)

  • @Mahmudulhasan-ts5hm
    @Mahmudulhasan-ts5hm Před 3 lety

    thanks

  • @learningit2572
    @learningit2572 Před rokem

    I love you!!!

  • @tarekghosn3648
    @tarekghosn3648 Před rokem

    for the algorithm we need to send this to the world.

  • @ridl27
    @ridl27 Před 3 lety

    ty

  • @himadribhargava8455
    @himadribhargava8455 Před 3 lety +1

    Awesome tutorial series

  • @allenjohn4863
    @allenjohn4863 Před 3 lety

    It would be great if we get a video on how to integrate Gpay into our website.

  • @all-in-all7862
    @all-in-all7862 Před 3 lety

    Can u create react-router beta version-6

  • @natnaelghirma2617
    @natnaelghirma2617 Před 3 lety

    Is there a better way to route. It seems very tedious to create routing this way. If you have 20 routes, it will be like 60 lines.

    • @developerbox3079
      @developerbox3079 Před 3 lety

      did you find a way?
      because I have a same problem as well .d

  • @matthewsteedman6867
    @matthewsteedman6867 Před 2 lety +1

    Hey Guys , "Switch" has been Deprecated is there any other alternative?

    • @JanabSmile
      @JanabSmile Před 2 lety

      Use 'Routes' instead of Switch.... just replace every 'Switch' with 'Routes'

  • @adelgafo7412
    @adelgafo7412 Před 3 lety

    good job sir

  • @user-ii6if3qw5o
    @user-ii6if3qw5o Před 5 měsíci

    Update in react-router-dom V6
    return (





    );

  • @ZTF666
    @ZTF666 Před 2 lety

    compared to nuxt , nuxt is a blessing in this area ! haha

  • @nick_jacob
    @nick_jacob Před 3 lety

    Why wouldn't they just build in the 'exact' property into the 'path' property? That seems unnecessary.

  • @artihlec
    @artihlec Před 3 lety

    actually /c will not match /create , but /np will match /np/something (things between slashes must be exactly the same )

    • @Ridhu
      @Ridhu Před 3 lety

      "Things between slashes" also refers to things after the last slash right?

    • @developerbox3079
      @developerbox3079 Před 3 lety

      @@Ridhu try and seeeeeee

  • @vojka2973
    @vojka2973 Před 2 lety

    Ninja can you do react tutorial on udemy bro ?! PLZ

  • @ckatke
    @ckatke Před 3 lety

    Ohh 😯 I thought it was all

  • @Jacksons_are_jackson
    @Jacksons_are_jackson Před 2 lety

    routerv6 done this by default :D

  • @akkaradechsrithongchai7766

    🙏

  • @memory8888
    @memory8888 Před 4 měsíci

    Let's save that now and... pRRreview.

  • @christianibana933
    @christianibana933 Před rokem

    React router v6 made routing easier and less code

  • @jyotirmaysengupta2360
    @jyotirmaysengupta2360 Před 3 lety +2

    First

  • @icetmzz9074
    @icetmzz9074 Před rokem

    this is no longer needed in v6

  • @muskankoshti2665
    @muskankoshti2665 Před 2 lety

    plzzzzzzzzzzzzzzzzzzzzzz share the codeeeeeeeeeeeeeeeeeeeee

  • @taicheeeee
    @taicheeeee Před 11 měsíci +1

    【2023/6/29】
    #NO NEED TO WATCH THIS CLIP.#
    I think the content this clip talked about was kind of bug of react routers.
    However, they've fixed this problem.
    Don't need to watch this video now.

  • @PamdoraPam
    @PamdoraPam Před 2 lety

    Is not easy to understand the routes, I had to figure out that you already made the hrefs in the navbar point to the routes you were using here

  • @subee128
    @subee128 Před rokem

    Thanks

  • @shiyadh4471
    @shiyadh4471 Před 2 lety

    thanks

  • @jacobzak7494
    @jacobzak7494 Před rokem

    Thanks