Next.js Data Fetching, Dynamic Routes & Metadata | Nextjs 13

Поділитися
Вставка
  • Опубліковано 6 лис 2024

КОМЕНТАРІ • 306

  • @leomacdon7858
    @leomacdon7858 Рік тому +12

    I love spending time on your UA-cam channel coz that is where all useful information I need is coming from.
    Thank you Dave.

  • @dopetag
    @dopetag Рік тому +9

    You opened my eyes to fetching in parallel, typing and much more.
    Thank you, Dave! You always go much more in details even than these paid courses. I appreciate your valuable time spent on creating these series!

  • @osamahima6698
    @osamahima6698 Рік тому +3

    This is no doubt the best channel for teaching Front-end development thank you so much MR.Dave

  • @catalin-rizea
    @catalin-rizea Рік тому +15

    Thank you for this series, Dave! It helps me a lot. There are a few VS Code extensions (like "JSON to TS") that can convert the copied JSON object from the clipboard into a type.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +3

      Nice tip!

    • @CRAETION_
      @CRAETION_ Рік тому +2

      that plugin you mentioned is a huge game changer!! thank you for the recommendation

  • @hamzaashraf9529
    @hamzaashraf9529 Рік тому

    You know i have watched a lot of tutorial but your tutorials are the real deal honestly speaking you are the best instructor i could ever found

  • @tasanee87
    @tasanee87 Рік тому +1

    Thank you for making these videos! I dont know TypeScript but I can easily follow along in JavaScript even with all the current changes in Nextjs, you're an amazing teacher!

  • @naylord5
    @naylord5 Рік тому +3

    Thank you a ton Dave! you are a life saver
    Please consider integrating next auth for this project, it would be amazing

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +1

      It is a popular request! Fundamentals first but we'll see how it all goes 🚀

    • @naylord5
      @naylord5 Рік тому

      @@DaveGrayTeachesCode appreciate that! Thank you for considering it.
      Waiting impatient for the next great video.
      Happy weekend!

  • @rastapoile
    @rastapoile Рік тому +1

    Hi Dave, I really like your videos on Nextjs. You get to the point without wasting time with layout for example and you structure your application correctly unlike a lot of other people!

  • @Grishopping
    @Grishopping Рік тому +3

    Thanks friend Dave, I was waiting for the video... I'm going to watch it now.....
    Hopefully the scope of this (video series) can talk about next-auth, prisma, mongo and the security part.....
    just some tips so that you can take them into account to evaluate and see if you can add them to this fantastic series of NEXT
    Thanks again for sharing your knowledge.
    Greetings from Venezuela your friend Jose Grillo

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +1

      Thank you Jose. I'm going to focus on Next.js - I have other videos for Mongo for example. However I may need to use some other tech in a project.

    • @Grishopping
      @Grishopping Рік тому

      @@DaveGrayTeachesCode Gracias

  • @anantgupta7352
    @anantgupta7352 Рік тому +3

    Hello Dave
    I will be very grateful if you please cover entire React Native App Development in near future.
    Thanks a lot.And simply you are the best 🙏

  • @Niamudeen
    @Niamudeen 10 місяців тому

    Thanks a bunch. You never disappoint Dave. I'm a aspiring mern stack developer. There's always something new to learn from you. 😊

  • @khumanjeel7417
    @khumanjeel7417 Рік тому +4

    If you'll add ts to your snippet it will add type Props to your function declaration..
    Ex: rfc will be tsrfc

  • @siddiqahmed3274
    @siddiqahmed3274 Рік тому +1

    Watched the whole video though i am not currently writing any next js code. The content is really good. I hope to comeback soon when i feel ready for next js.🙂
    Thank you🙏🌟❤️

  • @exciting8887
    @exciting8887 Рік тому

    Just wanna say thank you, Dave! Your NextJS tutorial is the best, hands down.

  • @nazar1744
    @nazar1744 Рік тому +1

    What a great lesson! Especially for me as a junior this is pure gold

  • @khalilbenmeziane8836
    @khalilbenmeziane8836 Рік тому +1

    thank you dave best teacher ever

  • @TravinskiyVladislav
    @TravinskiyVladislav Рік тому +5

    Thank you Dave!

  • @drkgumby
    @drkgumby Рік тому

    Excellent pacing and editing make this tutorial a joy to watch.

  • @veuler7376
    @veuler7376 Рік тому

    Excellent tutorial. Explaining everything even if it's little, even if it's not related to the topic, is great.

  • @laurraileanu8374
    @laurraileanu8374 Рік тому

    great tutorials as always Dave, you make the internet a better place for learning!

  • @markspratt7191
    @markspratt7191 Рік тому

    Clear and concise. You make an excellent teacher.

  • @costagmc1
    @costagmc1 Рік тому

    Excellent, Dave. Thanks. I like the way you teach.

  • @vramosjd
    @vramosjd Рік тому +3

    Hello Dave, on 20:41 when you hover over the link it starts prefetching the data however on my end it does not?

    • @webdeveloper371
      @webdeveloper371 Рік тому

      me too, It does not prefetching the data when I hover Users Link

  • @leonomollo7836
    @leonomollo7836 Рік тому

    I came here expecting to figure out how Next Js works. Wasn't expecting promises to finally click. Just had a eureka moment after ages using promises based on my memories from cramming and repetition. pretty sweet! lol.

  • @rohit_dev
    @rohit_dev Рік тому +1

    Keep it coming man. You're awesome 👌

  • @ifeanyiibe9153
    @ifeanyiibe9153 Рік тому

    Insightful and to the point, as always. Your channel has been a goldmine, Dave. Thanks for all you do.

  • @ghassanclassic7689
    @ghassanclassic7689 Рік тому

    Thank you very much Dave. You explain with every single detail 🙏

  • @slowcoding
    @slowcoding Рік тому

    Nothing but compliments after watching your excellent video. Well and clearly explained!! Thanks a ton.

  • @franalcaraz1676
    @franalcaraz1676 Рік тому

    Excellent lesson, going for the next!!

  • @Ellenox147
    @Ellenox147 Рік тому

    Awesome tutorial with the latest features of NextJS ! Thank you Dave !!

  • @andreamagista6742
    @andreamagista6742 Рік тому

    Thanks Dave, I love this series and all your videos in general . I would love it if you could cover the integration of next 13 with material ui

  • @andysfavoriterecipes3847
    @andysfavoriterecipes3847 Рік тому

    I came here for that typescript error, thank you for pointing out that documentation.

  • @galichandreyschool
    @galichandreyschool Рік тому

    Thank you for great tutorial series! ❤ 😊

  • @willyhorizont8672
    @willyhorizont8672 Рік тому +6

    Can't wait to see how to implement route protection in NextJS like in the previous traditional ReactJS tutorial using JWT access & refresh token & HTTP only cookie :)

  • @nishgro191
    @nishgro191 Рік тому

    Hello Dave, Thank you very much for giving us such a wonderful series.

  • @bobyuan5475
    @bobyuan5475 Рік тому

    I love your tutorial as well, thanks. For the user type, I would use either interface or class to strongly type the user object, instead of using type, just my opinion.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +1

      TypeScript is strongly typed. The choice of type or interface doesn't change that. It is often preference. I use type most of the time, but when I use classes I prefer interface.

  • @rayusaki88
    @rayusaki88 Рік тому

    Thanks for this Dave. Much appreciated the efforts. 🙏🏻🙏🏻

  • @amitbentzvi5019
    @amitbentzvi5019 Рік тому

    Hi! I wanted to ask about the reasoning behind placing the types and lib in the root directory. Thanks!🙏

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому

      I always put my lib directory there, but all of these are preferences. You can place them where you want to. Devs debate whether to use the types.d.ts file or create a directory for types. I've done both before.

  • @noiam8351
    @noiam8351 Рік тому

    this code is above my head 🔥🔥🔥🔥

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +1

      Take it slow and review the prerequisites listed in the course resources if needed.

  • @adnantariq3346
    @adnantariq3346 6 місяців тому

    hi, and a big thank you for making these series of next.js tutorials.
    Question is there any particular reason why we are avoiding fat arrow function when defining these components??? I noticed in lessons 1 and 2 you avoiding the fat arrows functions

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  6 місяців тому

      Sticking with the same pattern you see in the Next.js docs.

  • @SAmacTut20
    @SAmacTut20 Рік тому +1

    Just learned the difference between 'single quotes' and `backticks` from this video. Could't figure out why string literals never worked for me 😅

  • @akinsanmiakintunde4853
    @akinsanmiakintunde4853 Рік тому

    Very explanatory... Thank you dave

  • @k303k
    @k303k 11 місяців тому

    Thanks a lot sir ! I can understand it clearly

  • @omidsoleimani3817
    @omidsoleimani3817 Рік тому

    thanks Dave, I believe this video belongs to the nextjs playlist too.

  • @QasisTechnologies
    @QasisTechnologies Рік тому

    Super.... i love its..awsome master ji..... please complete the NExt js project its really really awsome......

  • @bharath2508
    @bharath2508 Рік тому +2

    Dave,
    thanks

  • @okonkwo.ify18
    @okonkwo.ify18 Рік тому +1

    Dave is the best !

  • @flaviien
    @flaviien Рік тому

    Thank you from France

  • @alphaomegapepega9341
    @alphaomegapepega9341 Рік тому +1

    Hello.Great tutorials. I learned so much from you. I have a question tho.
    How can i create a database much like jsonplaceholder one,so i can access each one of my users by their id as an individual page? I think its some routing thing,but i could not find anything about it on internet.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +1

      You can create many different kinds of databases. MongoDB is a NoSQL database solution I like. For SQL, you could use Postgres or MySQL on PlanetScale.

    • @alphaomegapepega9341
      @alphaomegapepega9341 Рік тому

      @@DaveGrayTeachesCode i guess im not very advanced in it yet then. But its fine. Thanks for the great tutorials. I was trying to find some good stuff on youtube,but after i found your chanel,i really dont need to go anywhere else. So much content explained so well.

  • @abelmurua6980
    @abelmurua6980 Рік тому

    Awesome! Will this work to add Rich Snippets/ Schemas for SEO ?

  • @redfanush
    @redfanush Рік тому

    Thank you very much for your valuable time and dedication. I am waiting for the next tutorial

  • @sundeeepu
    @sundeeepu Рік тому

    Thanks for making this awesome tutorial.

  • @mitesh7998
    @mitesh7998 Рік тому

    This next videos is really good. Thanks 🙏

  • @kakun7238
    @kakun7238 Рік тому

    would really love a fullstack application with nextjs 13 app and prisma thank you for all the tutorial videos!!

  • @trusht
    @trusht Рік тому

    Thanx Dave, very informative.

  • @Thongtele
    @Thongtele Рік тому

    Very cool. Thank you Dave.

  • @shahnawazk
    @shahnawazk Рік тому

    Very nice and informative, keep it up!

  • @ramachandra7015
    @ramachandra7015 Рік тому

    Thanks you Dave!❤

  • @h3nry_t122
    @h3nry_t122 Рік тому

    really nice tutorial man ! :)

  • @aleksandrpetrov3938
    @aleksandrpetrov3938 Рік тому +1

    I can't see prefetching in devtools of users/:id pages when hovering on links? What could be the reason?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +2

      It currently only does this in production, not dev mode. To see the exact behavior I get in this video, install the version of Next.js listed in my package.json in the provided source code.

    • @en_kratia
      @en_kratia Рік тому

      @@DaveGrayTeachesCode Thank you for answer.

  • @m95f0215
    @m95f0215 Рік тому

    謝謝你,Dave

  • @Mobilemaniaplays
    @Mobilemaniaplays Рік тому +1

    I have some problem in understanding this , can you make a simple video on this topic

  • @ArifulIslam-ic7zt
    @ArifulIslam-ic7zt Рік тому

    amazing tutorial

  • @nabinsaud4688
    @nabinsaud4688 Рік тому

    Nextjs 13.2 totally changed the way we used to do for api

  • @lucasigarashi
    @lucasigarashi Рік тому

    Thanks for the clear explanation

  • @Abdullab_Niaz-ri1sc
    @Abdullab_Niaz-ri1sc Рік тому

    Sir, really follow you . Your are such great mentor and teacher, please main node js with stripe method and connect to shopify, or any course please recommend me ?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому

      Thank you. No recommendations on course with stripe or shopify, but thank you for the request!

    • @Abdullab_Niaz-ri1sc
      @Abdullab_Niaz-ri1sc Рік тому

      @@DaveGrayTeachesCode sir, please can you guide me about or make anu video node express with stripe method. Thank you

  • @AndriyNosov
    @AndriyNosov Рік тому +1

    Hi. I have a question about dynamic metadata. I get an error: The Next.js 'generateMetadata' API is not allowed in a client component. How can I use generateMetadata in the client component?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +1

      You cannot use it in a client component. It is generating metadata for static pages and a client component has interactivity = not static. Ideally, you would have "islands" of interactivity in an otherwise static page so you could have metadata for the static page that has a client component within.

  • @ilan117
    @ilan117 Рік тому +1

    Dave ❤ priceless 🙏 It would be nice if you would go just a bit slower in the next tuts 😊

  • @sonamohialdin3376
    @sonamohialdin3376 Рік тому

    Thank you for this amazing tutorial

  • @alexanderkomanov4151
    @alexanderkomanov4151 Рік тому

    Thanks Dave!

  • @Sharky1101
    @Sharky1101 Рік тому +1

    Dave, how would you implement a solution where the user page (child) get its data from the users page (parent), as opposed to fetching data again for the (child) user page? I know that it’s not necessary for your page, but I have a use case where I need to do something like that.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +1

      When pages change, if you are passing data, it is going to come from params. However, remember that fetches are deduplicated. If you need the same data as before, just fetch again. It does not create a duplicate request. The docs recommend "fetch where you need to".

    • @Sharky1101
      @Sharky1101 Рік тому

      @@DaveGrayTeachesCode I find it a bit hard to wrap my brain around. I mean you do a fetch on a promise, which implies that if the promise has finished it managed to get the data. So in my child page I need to do the same fetch on a promise again, but in the background it does not repeat this cycle as its the same request?

  • @patite3103
    @patite3103 Рік тому

    Thank you for the video!

  • @ismail-talb
    @ismail-talb Рік тому

    Thank you Dave,you're the best teacher .I 've a small request concerning implementing Swiper slider with Next13,it've tried it but it's not working with nextjs but it works with React ..do have any idea about that ?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +1

      Thank you! I do not have a solution for your question as I have not worked with that yet.

    • @ismail-talb
      @ismail-talb Рік тому

      @@DaveGrayTeachesCode thank you I appreciate the response

  • @_chaika8922
    @_chaika8922 Рік тому

    Is it posible to make dynamic route with complex type? For instance using type person {id:1,age:10} instead of string?

  • @donald_hook
    @donald_hook Рік тому

    Thanks for the video. Curious, what theme are you using?

  • @nademkhan931
    @nademkhan931 Рік тому

    So the layout at a lower level in the file hierarchy is 'in addition to' the layout that is coming from upstairs, and not 'instead of'. Correct?

  • @aurelienchevillotte2874
    @aurelienchevillotte2874 Рік тому

    Thanks for this awesome tutorial Dave :) Could you tell me why you don't need to use UseEffect on your components to fetch data at the initialization ? (for exemple on the usersPage). Thks :)

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +2

      You can fetch in a server component without useEffect. The UsersPage is a static component so we are not thinking about re-rendering it in this situation either. It simply fetches the data, renders on the server, and is sent out to the CDN. Next.js 13 Fetch reference: beta.nextjs.org/docs/data-fetching/fundamentals

  • @이름-f9z
    @이름-f9z Рік тому

    hey Dave,
    i havent migrated my old personal project built with the pages router to the app router but is it possible to use the metadata API with the pages router?
    i just wanted to implement the metadata API feature over my custom Next Head component as a challenge if possible.
    would the use of the metadata API be ok to use over the custom Head?

  • @muscaiu
    @muscaiu 10 місяців тому

    Prefetching on hover doesn't seem to work in NextJS 14.0.4

  • @dopetag
    @dopetag Рік тому

    16:32
    this async function and await will work fine without Promise
    const userData will infer Promise
    Do you think it's a bad practice?

  • @vikashgauravvkg
    @vikashgauravvkg Рік тому

    excellent tutorial

  • @joaquinarlettaz
    @joaquinarlettaz Рік тому

    Dude this is amazing! I'm newbie using Next and I've been doing an app to practice with some requests and I didn't know the right way to handle it, It helped a lot, thanks for all, new sub, tuned for more! 🤍

  • @nelsonurbaneja6875
    @nelsonurbaneja6875 Рік тому +1

    Hello Dave, Next 13 is available for production?

  • @ilan117
    @ilan117 Рік тому

    Dave … is there away to watch entire series ? Or we have to wait to the next recording every now and then ?

  • @kuroisan2698
    @kuroisan2698 Рік тому +1

    Can you make a video about how Next js works in Client and Server side
    I mean when I wrap a server component with a client component does that mean the server component will be treated as a server component ?
    not sure but I think it is No

  • @olegmaz3969
    @olegmaz3969 Рік тому

    If I correct understand now we do not have the getServerSideProps function as in Next12?

  • @victorkimura1
    @victorkimura1 Рік тому

    Hi Dave, love your tutorials. God bless you<
    I'm wondering what's the difference (pros/cons) of using '/app/users/[userId]/routes.js' instead of your directory of 'lib' directory?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому

      The lib directory is for functions I may use in more than one place. It is short for "library". The other is a dynamic route. Note, it should end in route.js or route.ts and not "routes".

  • @renatoAllArt
    @renatoAllArt Рік тому

    there's any difference between eatch other?
    1:
    const userData: Promise = getUser(userId)
    const user: User = await userData
    2:
    const user: User = await getUser(userId)
    both worked here.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому

      The difference: You are not awaiting getUser() in the first one. That could allow you to start other requests as well and then await all of them in Promise.all or Promise.allSettled. This is in the docs under Parallel Requests.

  • @mohamedmagdy8382
    @mohamedmagdy8382 Рік тому

    I'm just starting to watch this awesome tutorial but I think that fetching on hover Is not working for V13.4, but docs say it's working but some github issues say it's not working in that version, so I will hope if you can tell is it still working or not?
    docs say it's working in production but it's not working also

  • @dopetag
    @dopetag Рік тому

    36:51 I see that they removed this workaround from the docs. But it is still needed in the code to work.
    Version: next.js 13.2.4
    I still get:
    'UserPosts' cannot be used as a JSX component.
    Its return type 'Promise' is not a valid JSX element.
    Type 'Promise' is missing the following properties from type 'ReactElement': type, props, keyts(2786)

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому

      I'd suggest using the workaround until it is not needed. I'm surprised they removed it from the docs if it is still needed.

  • @desgnify
    @desgnify Рік тому

    Thank you so much am really grateful

  • @hooyah
    @hooyah Рік тому

    Hi Dave, can you make tutorial for this.
    my friend have backend auth and return userData, token, refresh_token. how to handle this case in a proper way

  • @bobdpa
    @bobdpa Рік тому

    Awesome!

  • @HimanshuGogoi
    @HimanshuGogoi Рік тому

    Can I use NextJS experimental feature in my production app or should I go with the previous technique ?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому

      It's up to you. They don't recommend it. These new features should be out of beta soon.

  • @kevl7129
    @kevl7129 Рік тому

    As of Next 13.3 create-next-app puts the font import in the root layout file and the class name on the body tag by default... someone at Vercel watches Dave!

  • @0xtz_
    @0xtz_ Рік тому

    keep going 👌🏼

  • @mdshohidulislam5836
    @mdshohidulislam5836 Рік тому

    You are amazing

  • @syedabuthahira8053
    @syedabuthahira8053 7 місяців тому

    Hi Dave when I try to hover over the users link to pre- fetching is not happening for me don't know why can you help me resolve

  • @fabioalcocersejas2944
    @fabioalcocersejas2944 Рік тому

    Hi, excellent tutorial! Do you know if this app can be deployed on firebase hosting? Or next 13 is not compatible, I would appreciate the information!

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому

      This might help - it does not specify 13 or not: firebase.google.com/docs/hosting/nextjs

  • @ParmanandPatel-u8w
    @ParmanandPatel-u8w Рік тому

    excellence tutorial