Next.js 14 Tutorial - 7 - Dynamic Routes

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024
  • 📘 Frontend Interview Course - learn.codevolu...
    💖 Support UPI - support.codevo...
    💖 Support Paypal - www.paypal.me/...
    💾 Github - github.com/gop...
    📱 Follow Codevolution
    + Twitter - / codevolutionweb
    + Facebook - / codevolutionweb
    📫 Business - codevolution.business@gmail.com
    Next.js 14
    Next.js Tutorial
    Next.js 14 Tutorial
    Next.js Tutorial for Beginners
    Dynamic Routes
    Dynamic Routes in Next.js
    Next.js 14 Dynamic Routes

Комментарии • 110

  • @joja2174
    @joja2174 10 месяцев назад +51

    bro explained a 2 hours lecture in 7 mins

    • @king_james_official
      @king_james_official 3 месяца назад +1

      no

    • @mzohaib27
      @mzohaib27 22 дня назад

      actually bro is explaining very good... those who took 2 hours for this.. they are paid courses.... their goal is only to take money.... nextjs course... then nextjs advanced course... then nextjs project learning course etc..... that's why they are taking 2 hours on this.... bcz if they teach everything in one course who will buy second...

    • @joja2174
      @joja2174 22 дня назад

      @@mzohaib27 imo paid courses are very focused on giving EVERYTHING the good bad and ugly, the useful, useless and good to know, so they are not time efficient but definitely worth it, at least the good ones
      some things they tend to over explain which why i watch channels like this, straight to the point

  • @billb1365
    @billb1365 Месяц назад +12

    Outstanding tutorial! I first watched the lessons and now watching a second time while coding in parallel. Thanks for developing such exceptional content.

  • @Regiomer
    @Regiomer 9 месяцев назад +3

    Does this work with js also?
    It renders only the "404 page not found" component in my case

    • @saintrivers962
      @saintrivers962 7 месяцев назад

      Yeah, I'm having the same problem.

  • @uquantum
    @uquantum 4 месяца назад +4

    Thanks so much❤ I’d moved so quickly to astro (ssr) a couple years ago, but now I have a next.js project, so I really appreciate your presentation style and the content to get me up to speed.

  • @AjikwuC.Wilson
    @AjikwuC.Wilson 10 месяцев назад +9

    Thanks. I'm following this course as soon as they drop. Promise to finish it with you. This is great

    • @Usama-Tanoli
      @Usama-Tanoli 6 месяцев назад

      so as you might finished this could you tell me how is this

  • @euroclydon7883
    @euroclydon7883 10 месяцев назад +9

    Your explanations are top notch

  • @misalambasta
    @misalambasta Месяц назад +1

    Those who are wondering where the params come from. The folder name [productId] will pass as a params in page.tsx file of the same folder.

  • @jesssdad
    @jesssdad 10 часов назад

    For me it didn't work as it didn't display the product ID after 'Details about product'. For anyone having the same issue first thing to check is that the folder is named [productId], mine was [productID] and it couldn't match/find the page.
    So the big lesson here is that next.js is case-sensitive.
    The only way I could work out how to debug it was to use postman and look at the actual response from the server which contained the following content (buried in a HTML tag)
    "{\"children\":[\"Details about product \",\"$undefined\"]}]
    5:[\"productID\",\"1\",\"d\"]
    7:D{\"name\":\"RootLayout\",\"env\":\"Server\"}
    8:D{\"name\":\"NotFound\",\"env\":\"Server\"}
    8:[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}"
    In other words the server simply returned 200 = OK as a status on a 404 page.
    I'm guessing this type of issue is handled in a later video?

  • @md.Alamin-ej6ro
    @md.Alamin-ej6ro 4 месяца назад +1

    Damn THIS was too good, it helps me a lot i was searching for this type of content but everyone just explained it in a more difficult way , anyway it was damn good to understand the basics of the dynamic routes. Thanks a lot..

  • @ONEHLOFIOCHIOCHEME
    @ONEHLOFIOCHIOCHEME Месяц назад +2

    Vishwas is a gifted teacher and educator. You are a gift to mankind dear Vishwas.

  • @aakashyadav6228
    @aakashyadav6228 9 месяцев назад +3

    Bro, please continue with the series.

  • @omozemojeaugustine3529
    @omozemojeaugustine3529 5 месяцев назад +2

    Am following the series thanks for breaking this down to this level

  • @MALI-gj8sk
    @MALI-gj8sk 8 дней назад

    But NextJs docs says folder name should be like this: pages/products/[id].js.

  • @navjotsingh5303
    @navjotsingh5303 17 дней назад

    with dynamic routes i could't able to make build with static export can anyone help me with this

  • @emmanuelkpogo9319
    @emmanuelkpogo9319 2 месяца назад +1

    Great tutorial. Very comprehensive.

  • @riavi
    @riavi 6 месяцев назад +2

    Thanks! This cleared up what my instructor meant by dynamic routes, I didn't get it in class.

  • @worldoflanguages1043
    @worldoflanguages1043 2 месяца назад

    what;s this error in console Warning: Extra attributes from the server: cz-shortcut-listen

  • @shubhaverma5697
    @shubhaverma5697 3 месяца назад +1

    Wow. Amazed by the content you provided in 7 minutes. I must have tried to learn about dynamic routes from so many resources, never quite understood it until now.

  • @tensorbaba7687
    @tensorbaba7687 2 месяца назад

    why do we destructure params in paramerters of function component?

  • @shresthagaurab2193
    @shresthagaurab2193 8 месяцев назад +1

    Thanks u so much step by step , it's very helpful

  • @adityarajaram3124
    @adityarajaram3124 9 месяцев назад +1

    I have question while deploying in next js 14 with app router (Dynamic Route) it's not supported. Do you know any way?

    • @iqbalali3341
      @iqbalali3341 9 месяцев назад

      I also have the same problem, have you found a solution?

    • @victoragese9275
      @victoragese9275 8 месяцев назад

      Same here

  • @HassanAKhann
    @HassanAKhann 5 месяцев назад +1

    Saviour

  • @ailton.duarte
    @ailton.duarte 3 месяца назад

    my layout is not working in productId, do u know why?

  • @minseongkim3278
    @minseongkim3278 2 месяца назад

    This video must be accepted by official docs

  • @bj0urne
    @bj0urne 5 месяцев назад

    My VS Code doesn't automatically format my code when I save the file like yours does... Is that an extension you're using?

  • @ObjectiveTruth-zm3hi
    @ObjectiveTruth-zm3hi 4 месяца назад

    isn't TypeScript a waste of time ?

  • @latifurrahman2648
    @latifurrahman2648 7 месяцев назад +1

    this course helps me very much. you are the best instructor

  • @harshitshrivastava114
    @harshitshrivastava114 5 месяцев назад

    why my params.productID is showing undefined in console.log

  • @yogita868
    @yogita868 6 месяцев назад

    I have this created this file structure in Next js version ->14
    project\[[id]]
    Inside page.tsx I have this code->
    'use client';
    import PathwayContainer from '@/components/Pathways/PathwayContainer';
    const PathwayPage = () => {
    const clientID = '06375fa6-999a-46a8-9d80-12e41e76aa52';
    return (
    );
    };
    export default PathwayPage;
    This clienID I would fetch from useselector later as of now i keep code like this.
    and this is the component for PathwayContainer.
    'use client';
    interface IPathwayContainerProps {
    fetchClientProjects: (clientId: string) => Promise;
    clientID: string;
    }
    const PathwayContainer: FunctionComponent = (props) => {
    const {
    fetchClientProjects,
    clientID,
    } = props;
    const [loading, setLoading] = useState(false);
    const [activeProjectList, setActiveProjectList] = useState([])
    useEffect(() => {
    const getActiveProjectList = async () => {
    try {
    setLoading(true);
    const projectInfo = await fetchClientProjects(clientID);
    setActiveProjectList(projectInfo);
    }
    catch {
    }
    finally {
    setLoading(false);
    }
    }
    getActiveProjectList();
    }, [clientID])
    return (
    {activeProjectList.map((activeProject, index) => (

    {activeProject.name}

    ))}

    );
    };
    export default connect(() => ({}), {
    fetchClientProjects: actions.clients.fetchClientProjects,
    })(PathwayContainer);
    whevaver user clcik on this link which i have crated using clientID is not changed but my useeffect code runs again and again whenver user click on links. same code works fine in react. How can i solve this issue.please help.

  • @ViniciusRodrigues-st8mw
    @ViniciusRodrigues-st8mw 24 дня назад

    Thank you very much Sir!

  • @elenak2528
    @elenak2528 8 месяцев назад

    Thank you! Where did you find it? There is no this info in documentation I think. Only with the help of your video I managed to finally do dynamic routes ( params especially are never mentioned in documentation, or I am stupid I don;t know)

  • @yinonelbaz5309
    @yinonelbaz5309 10 месяцев назад +2

    You are doing a great and wonderful job!

  • @bhn1997
    @bhn1997 7 месяцев назад +1

    Thanks for your guides. Exactly what I wanted to render!

  • @nicolaskorner9351
    @nicolaskorner9351 8 месяцев назад

    Hey Codevolution & watchers,
    In your dynamic routes we're using params. Is there any difference to your usage and type declaration compared to NextJS useParams für dynamic routes? In their docs they create a variable with const params = useParams (and import it). Thanks for your videos!

  • @gboyegaoluwatobiloba8585
    @gboyegaoluwatobiloba8585 2 месяца назад

    seems using typescript is a hassle

  • @kevinchittilapilly8221
    @kevinchittilapilly8221 6 месяцев назад

    Thanks for the lecture. I have a doubt. How can I add a check so that only if the productId is a number, I navigate to the right page. But if the user enters something like product/temp it does not navigate to the productid page

  • @gettingoverit__
    @gettingoverit__ 2 месяца назад

    how to do it programmatically

  • @anasouardini
    @anasouardini 3 месяца назад

    BRO, you've been repeating the same thing in the last 3 videos

  • @JagadishL-wj6sn
    @JagadishL-wj6sn 5 месяцев назад

    How do you handle 404 page for dynamic routes

    • @nxtalex10
      @nxtalex10 4 месяца назад

      well, lets say you are searching for that id in the database and returning its properties, then yuo can do a conditional rendering to see if your api returned the data or returned a 404 error!

  • @warriors_edge
    @warriors_edge 4 месяца назад

    fuckin amazing, thank you

  • @jonathanguerrero5991
    @jonathanguerrero5991 7 месяцев назад

    Dynamic routs information start at minute 4:00 all previously said is not dynamic routes.

  • @manuelrosalesmaquieyra9687
    @manuelrosalesmaquieyra9687 4 месяца назад

    bestia animal idolo

  • @thespiritninja11
    @thespiritninja11 2 месяца назад

    THIS HELPED SO MUCH! Thank you 🫡

  • @auricaputri7664
    @auricaputri7664 3 месяца назад

    great tutorial video, my first day learning your course!!

  • @rahmannurudin5003
    @rahmannurudin5003 10 месяцев назад

    where's _app module in newest next.js version?

  • @budifajriarzi4233
    @budifajriarzi4233 8 месяцев назад +1

    Thank you for step-by-step tutorial, very helpful

  • @osaka-ben9291
    @osaka-ben9291 9 месяцев назад

    thank you so much ! i was struggling with NextJs router specially with the 14.0 version because we're not using the folder "pages" anymore if i get it right.

  • @jeffreyndukwe3869
    @jeffreyndukwe3869 10 месяцев назад +1

    You are doing a great and wonderful job. Nice teaching

  • @sahandsepidar4089
    @sahandsepidar4089 10 месяцев назад

    i only tought the only way to get the paramd is using hooks , i didnt know about params ; thank you

  • @brunelleagboton161
    @brunelleagboton161 14 дней назад

    Thanks a lot

  • @MTran-r8c
    @MTran-r8c 4 месяца назад

    Thank you so much for the guide! ❤

  • @syedakashish5913
    @syedakashish5913 8 месяцев назад

    explanation is so good.And it seems like john the don it teaching.

  • @2u841r
    @2u841r Месяц назад

    Thank you.

  • @rohit_dev
    @rohit_dev 10 месяцев назад +1

    I am going to finish this series with you 🙌

  • @selvamkarthik9605
    @selvamkarthik9605 10 месяцев назад +1

    😊

  • @luisr2662
    @luisr2662 2 месяца назад

    Amazing!

  • @isagive
    @isagive 2 месяца назад

    תודה רבה, הסבר ענייני ומקצועי. 👍

  • @beybell
    @beybell 6 месяцев назад

    If someone gets an error, the id does not appear in the text on the page or next shows an error, check whether you wrote the ID correctly in the ProductId folder. In the folder name, the first letter I must be capitalized product Id

  • @DushyantJoshi
    @DushyantJoshi 7 месяцев назад

    Just Awesome. Thanks for this.

  • @omexaapp3062
    @omexaapp3062 4 месяца назад

    certainly u are the best.

  • @wojteeh
    @wojteeh 5 месяцев назад

    Very useful, thanks ;)

  • @Pipu748
    @Pipu748 4 месяца назад

    love it

  • @theangelofspace155
    @theangelofspace155 10 месяцев назад

    But what happen of we try to access a outOfRange dynamic route? Do we need to build that logic so if a user is trying to go to /[100] but we only have 50 resources? Or will nextJS render a 404 - not found?

    • @HimanshuGogoi
      @HimanshuGogoi 10 месяцев назад

      u need to manually redirect it to not found else it will still attempt to show the page

  • @HassanMehboob-ij1cq
    @HassanMehboob-ij1cq 7 месяцев назад

    How I can get id in nested component?

  • @GerardoAG
    @GerardoAG 2 месяца назад

    you are a genius bro, thaks

  • @asifnewaz477
    @asifnewaz477 7 месяцев назад

    Thanks bro! You are so cool!

  • @gabrielsouza4483
    @gabrielsouza4483 6 месяцев назад

    Why when im ussing output: export I got the error "Page "/[ID1]/[ID2]" is missing "generateStaticParams()" so it cannot be used with "output: export" config." ??? I dont have all possible values to ID2 and ID2 to generateSTtaicParams

    • @EzequielGrigolatto-lg6mz
      @EzequielGrigolatto-lg6mz 5 месяцев назад +1

      I'm getting the same issue, were you able to solve it?

    • @gabrielsouza4483
      @gabrielsouza4483 5 месяцев назад +1

      @@EzequielGrigolatto-lg6mz the """"fix""" is downgrad tô 13.4.9 , apparently next 14 release with this bug but never fixed

    • @EzequielGrigolatto-lg6mz
      @EzequielGrigolatto-lg6mz 5 месяцев назад

      @@gabrielsouza4483 thanks for your quick answer! unfortunately downgrade next version is not possible on my case, I'll look for other options then

    • @gabrielsouza4483
      @gabrielsouza4483 5 месяцев назад

      @@EzequielGrigolatto-lg6mz I tried almost everything , almost for two weeks, but if u find a solution tell me

  • @Ezzgamezzz
    @Ezzgamezzz 2 месяца назад

    Well explained 👍🏻👍🏻

  • @최재혁-k6j
    @최재혁-k6j 9 месяцев назад

    so useful teaching! Thanks

  • @tsmusic9587
    @tsmusic9587 7 месяцев назад

    NICE video

  • @yellhtetnaing2245
    @yellhtetnaing2245 10 месяцев назад

    waiting for next pieces

  • @Kmkn308
    @Kmkn308 10 месяцев назад

    waiting more videos

  • @zohaibafridi3522
    @zohaibafridi3522 9 месяцев назад

    will it work on build?

  • @andrewberrio7374
    @andrewberrio7374 7 месяцев назад

    Thank you sir

  • @igorluyz_
    @igorluyz_ 9 месяцев назад

    You are doing a great and wonderful job!

    • @adityarajaram3124
      @adityarajaram3124 9 месяцев назад

      I have question while deploying in next js 14 with app router (Dynamic Route) it's not supported. Do you know any way?

  • @mohitrathore8808
    @mohitrathore8808 10 месяцев назад

    Wonderful, keep going

  • @Txushin
    @Txushin 6 месяцев назад

    Thanks

  • @MucahitCanbey
    @MucahitCanbey 8 месяцев назад

    Thanks ✨✨

  • @behroozbk
    @behroozbk 8 месяцев назад

    best

  • @rickyanchores4464
    @rickyanchores4464 9 месяцев назад

    Great tutorial!!

  • @NguyênNguyễnTrung-r3x
    @NguyênNguyễnTrung-r3x 9 месяцев назад

    Thank you!

  • @chesterxp508
    @chesterxp508 10 месяцев назад

    GoodJob!

  • @nahar830
    @nahar830 10 месяцев назад

    Thanks

  • @gorkemgok9313
    @gorkemgok9313 6 месяцев назад

    The voice is AI. I am sure.

    • @nxtalex10
      @nxtalex10 4 месяца назад

      nah he is just Indian 🤣🤣🤣🤣🤣🤣

  • @riyad-appscode
    @riyad-appscode 10 месяцев назад

    Thanks 🙂

  • @yipmong
    @yipmong 5 месяцев назад

    Sir, words can not express our appreciation to your short and fully concised tutorial, we are very grateful for this. i watched a 3 hours tutorial but couldnt understand fully but yours of less than 10 mins i feel like a pro in this
    thank you so much for all you do sir❤❤❤

  • @sejeminecraft1
    @sejeminecraft1 7 месяцев назад

    Thank you so much. Short and precise, extremely helpful!

  • @its_Akhtar
    @its_Akhtar 2 месяца назад

    Thanks a lot

  • @tienhuynh2435
    @tienhuynh2435 2 месяца назад

    respect sir