Dynamic Catch-all Routes in NextJs 14

Поділитися
Вставка
  • Опубліковано 16 лип 2024
  • In this video, we'll look at dynamic routes, catch-all routes, and optional catch-all routes in NextJs 14.
    👉🏼 My courses
    → www.hamedbahram.io/courses
    👉🏼 Project source code (Github)
    → github.com/HamedBahram/next-d...
    👉🏼 Next shadcn template (Github)
    → github.com/HamedBahram/next-s...
    👉🏼 Work with me
    → www.hamedbahram.io/hire
    Chapters
    0:00 Intro
    1:00 Documentation
    10:30 Project setup
    12:40 Shared layout
    15:00 Catch-all route
    20:00 Active links
    22:20 generateStaticParams
    26:25 Recap
  • Наука та технологія

КОМЕНТАРІ • 41

  • @rogerscript
    @rogerscript 2 місяці тому +4

    Your videos are awesome Hamed, please, never quit doing them...

    • @hamedbahram
      @hamedbahram  2 місяці тому

      Thanks, I appreciate that!

  • @kazmi401
    @kazmi401 3 місяці тому +1

    Thank you, Hamid. I truly wish I had a teacher like you during my High school days and in College now. Each video on your channel contributes significantly to my growth as a developer. Thanks once again. 🙏

    • @hamedbahram
      @hamedbahram  3 місяці тому

      Thank you! I'm so glad to hear that I've been able to help you in your journey.

  • @raphauy
    @raphauy 3 місяці тому +2

    Hamed thank you very much! Your explanations are the best

  • @sergheic31
    @sergheic31 3 місяці тому +1

    Great explanation as always! Even if I knew this, your example project made it stick into my head, thanks!

    • @hamedbahram
      @hamedbahram  3 місяці тому +1

      I'm glad to hear that 🙂

  • @hassanallen1823
    @hassanallen1823 3 місяці тому +1

    thanks for your video,it was very helpful for my project just in time, I did similar to this but didn't know about all catch all folder witch help me organize it better

    • @hamedbahram
      @hamedbahram  3 місяці тому +1

      Awesome, I'm glad it helped!

  • @MuhammadHaseebAhmed
    @MuhammadHaseebAhmed 3 місяці тому +1

    Eid Mubarak Brother .Thank You For Your Contribution In React Community .

  • @mohsenmohammadi9205
    @mohsenmohammadi9205 3 місяці тому +1

    Thanks Hamed, you are awesome bro 😎

    • @hamedbahram
      @hamedbahram  3 місяці тому

      Thanks man! I appreciate it.

  • @user-pe4wq2dv7q
    @user-pe4wq2dv7q Місяць тому +1

    Very helpful. As for now, there is not a lot of info about Next 14.

  • @3relativesGroup
    @3relativesGroup 2 місяці тому

    Absolutely perfect explanation!

  • @dimahinev
    @dimahinev 3 місяці тому +1

    thank you bro, highly appreciate it

  • @yusufelmountahi5208
    @yusufelmountahi5208 2 місяці тому +1

    really great video thank you

    • @hamedbahram
      @hamedbahram  2 місяці тому

      You are welcome! Glad it helped.

  • @MiladJoodi
    @MiladJoodi 3 місяці тому +1

    Thanks a million 🎉

  • @AndriusLauFullstack
    @AndriusLauFullstack 2 місяці тому +1

    Nice explanation. Currently working on my side project, and I have a case staticPath/[location]/[type]/[criteria]. The idea was to duplicate code for each dynamic path or catch-all routes. Duplication allows more granular control without 'else if' cases. And catch all routes is good because in my case is just a filter option and all content will be almost the same (just different titles, metadata for SEO). I am also interested in how you sanitise slugs, or do you trust security features that come from ORM?

    • @hamedbahram
      @hamedbahram  2 місяці тому +1

      Thanks! I personally prefer the path with less code duplication. You can also sanitize slugs or search parameters using something like zod.

  • @sammtanX
    @sammtanX 3 місяці тому +1

    this is such quality content

  • @patolorde
    @patolorde 3 місяці тому +1

    Very good

  • @darawan_omar
    @darawan_omar 3 місяці тому +1

    explained very nice, but i have a question we can use the cookies inside generateStaticParams ?

    • @hamedbahram
      @hamedbahram  3 місяці тому

      Thank you! Give it a try and let me know :)

    • @darawan_omar
      @darawan_omar 3 місяці тому

      @@hamedbahram i got this error how we can solve it ------> headers() expects to have requestAsyncStorage, none available

  • @techGPT97
    @techGPT97 3 місяці тому +1

    how catch all different from by default params coming in page it also gives array of params

    • @hamedbahram
      @hamedbahram  3 місяці тому

      Only catch-all and optional catch-all routes have an array of strings for the params. The regular dynamic route just returns a string.

    • @techGPT97
      @techGPT97 3 місяці тому +1

      @@hamedbahram thanks for your content brother

    • @hamedbahram
      @hamedbahram  3 місяці тому

      @@techGPT97 my pleasure brother!

  • @AamirSohail-k7b
    @AamirSohail-k7b 11 днів тому

    hello

  • @kickflipz
    @kickflipz 3 місяці тому +10

    My eyes man.. please use dark mode in your vids 🥲

    • @hamedbahram
      @hamedbahram  3 місяці тому +2

      Absolutely! I'll that in mind