Next.js Client Components | Build a Small Project with Nextjs 13

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

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

  • @madfoodhunter
    @madfoodhunter Год назад +13

    one of the best teacher of my entire life , every day watch your videos

  • @7doors847
    @7doors847 Год назад +4

    Chef Dave has been “cooking” lately! 🥘 👌

  • @k303k
    @k303k Год назад

    only finished about 5 videos in this series but i've learned a lot .Thanks Dave!

  • @franalcaraz1676
    @franalcaraz1676 Год назад +1

    Impressive lesson as usual!. Lot of stuff, my brain is burning 😜. Thanks Dave!

  • @developer_hadi
    @developer_hadi Год назад +2

    Thanks brother dave, our big brother and teacher

  • @CRAETION_
    @CRAETION_ Год назад +2

    quick note at 26:57: since Wikipedia's query is actually returned as a key/value pair JSON object, I found that it's more accurate to type it as { [key: string]: Result } instead of Result[]. This more accurately represents why the results const is mapped over via Object.values(results) instead of just results.map() if it were already an array.

  • @junsgk
    @junsgk Год назад +1

    best best best next13 vid on YT

  • @Grishopping
    @Grishopping Год назад +2

    Greetings Dave, thank you very much for your videos... Jose Grillo from Venezuela over here..... Reporting, giving a hand up hahaha and commenting... one hand washes the other and both wash their faces
    many blessings...

  • @hbela1000
    @hbela1000 Год назад +3

    high quality tutos, thanks.

  • @andreaswu7973
    @andreaswu7973 Год назад

    wow thanks a lot Dave! I think you're the first one to cover the API search functionality for Next 13.2. actually I did refactor a 4 year-old react js tutorial build a lyrics app with next, and with the help from this video I refactor the app very very smoothly!

  • @sonamohialdin3376
    @sonamohialdin3376 Год назад +2

    Thank you for this amazing tutorial

  • @minhlytranbao3676
    @minhlytranbao3676 Год назад

    Thank you so much, this helps me a lot, please continue on this progress when Next get another update on Next 13, I see many difference feature that they did not release yet

  • @okonkwo.ify18
    @okonkwo.ify18 Год назад +1

    Yay Dave code tailwind css with next. Wat I needed

  • @kaushikkas8645
    @kaushikkas8645 Год назад

    Awesome video Dave! Just a tip - if you want to test whether loading works or not you can always use the chrome developer tools to change your network connection to slow 3G

  • @mrsparrow1530
    @mrsparrow1530 Год назад

    Hey Dave, thanks for your wonderful work. Can you please make a short video of "Best practise of directory structure of small or medium scale project with NextJS or any fullstack MERN or PERN application using MVC architecture"

  • @hinatashoyo7985
    @hinatashoyo7985 Год назад +1

    Thankyou for the amazing tutorials. Could you please tell how many videos are you planning for this course and till when?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      I don't have a set number of videos. I just follow the content.

  • @TravinskiyVladislav
    @TravinskiyVladislav Год назад +2

    Thank you, Dave

  • @synt-x6458
    @synt-x6458 Год назад +2

    Awesome series ☺️

  • @CRAETION_
    @CRAETION_ Год назад

    Excellent tutorial!

  • @mdtron
    @mdtron Год назад +1

    I watched your video "React Login Authentication with JWT Access, Refresh Tokens"
    I don't know where and how we can integrate it into nextjs.
    Maybe you can do the same concept, but for NextJS 13 tutorial in the future.

  • @زكرياالراوي-ل1ص
    @زكرياالراوي-ل1ص Год назад +1

    You amazing teacher

  • @armankangavary7866
    @armankangavary7866 Год назад +1

    thanks a lot for all great content of yours 🌷🌷

  • @MuhammadBilal-e5g5n
    @MuhammadBilal-e5g5n Год назад

    Wonderful explanation. that's what I was looking for. Can you please make a video of this new React component modal. Like how to decide which approach to use SSR or CSR and what would be the drawbacks of certain approach.

  • @dopetag
    @dopetag Год назад

    Amazing course! Keep it coming!

  • @dhavalmehta7525
    @dhavalmehta7525 Год назад +6

    Hey Dave, why do we need to create multiple components folders for different pages ? Like we have components folder for Navbar as well as dynamic page. Instead of that can't we just create one folder for components ( Inside the app directory ) and use it everywhere

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +4

      I prefer this organization as it keeps components with their branch/route. However, you can organize your files however you want to. I show examples - not the _only way_ to do things. There is usually more than one way.

    • @codernerd7076
      @codernerd7076 Год назад

      I looked into this a while ago seems a lot of companies prefer this, if your project goes bigger your root components folder will be really hard to navigate. Also, this was one of the driving forces behind the App directory. Before Next worked with a page folder and every file inside it no mater what name you gave became a page...

  • @thedude6810
    @thedude6810 Год назад

    Your videos are awesome, very helpful!

  • @Aejkv
    @Aejkv Год назад

    Hello Dave, just switching from CRA to Next and watched all your Next Content, thanks for sharing it, that's really great !
    btw in this project i had to create a function
    // function removeHtmlTags(text: string): string {
    return text.replace(/]+>| /g, '');
    } //
    otherwise text was displayed with html tags ...

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      Good note! I didn't notice that, but maybe I didn't search for the right things from the Wikipedia API.

  • @5050U
    @5050U Год назад +1

    Thank you
    Can't wait for the server components
    And please use Postgres, not Mongo

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +2

      I previously covered server components in the earlier lessons? You mentioned databases - one may be used after this but it might be best to make it as a follow up video as it is a separate technology.

  • @khalilbenmeziane8836
    @khalilbenmeziane8836 Год назад +1

    thank you dave

  • @FoodBitesTV
    @FoodBitesTV Год назад +1

    This is a good start tutorial, thank you Dave! I have a question is it better if we can make the error and loading page reusable, instead placing them inside the [searchTerm] folder instead having error and loading page for each page folder?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      Yes, you can get more granular at each level if you want, but errors will bubble up to the nearest boundary. Discussion here: beta.nextjs.org/docs/routing/error-handling#nested-routes

  • @arashfad6539
    @arashfad6539 Год назад

    it was great thank you dave

  • @deogenesabejuela7016
    @deogenesabejuela7016 Год назад

    Amazing. Thanks

  • @sahadevdahit
    @sahadevdahit Год назад +3

    Any Nextjs with typescript videos??

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      Have you watched this series? TypeScript is in all of the videos.

    • @sahadevdahit
      @sahadevdahit Год назад

      Yes, I am watching... Just asked is there any separate playlist or not

    • @sahadevdahit
      @sahadevdahit Год назад

      Love to see you as my mentor ❣️❣️❣️

  • @alexanderkomanov4151
    @alexanderkomanov4151 Год назад +1

    Wow! Thanks!

  • @sahadevdahit
    @sahadevdahit Год назад +2

    Keep it up 🙂🙂🙂

  • @abuhossain4274
    @abuhossain4274 Год назад +1

    i am still not ready for nex.js 13 makes me confuse now! specially in layout face is unusual to me

  • @lakshmananravi4178
    @lakshmananravi4178 Год назад

    Sir thanks a lot for the lesson 😊. I have one doubt handleSubmit function on search component why is it an async function.

  • @aurelienchevillotte2874
    @aurelienchevillotte2874 Год назад

    Hey Dave. Thks for this video. In this video you call a dynamic route called [SeachTerm] from Search component. I don't see where you define that your search component will call that specific dynamic route [SearchItem] and not another (in case there would be others) ?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      The Search component uses router.push to add the search term to the URL. The dynamic [searchTerm] route represents that search term. The page.tsx in that route pulls in the term as a param. You can check the source code in the course resources for this lesson if you missed that in the video or rewatch.

    • @aurelienchevillotte2874
      @aurelienchevillotte2874 Год назад

      @@DaveGrayTeachesCode Thks :) I've seen this. But you call in the component : "router.push(`/${search}/`)". search is different than [searchTerm] if I have another route dynamic [exempleTerm]. How do you define that "router.push(`/${search}/`)" must use [searchTerm] and not [exempleTerm] ?

  • @thecapellett
    @thecapellett Год назад +1

    I was following along, but for some strange reason, is giving me an error on [searchTerm] page: TypeError: cookies is not iterable, which I couldn't figure out why

    • @thecapellett
      @thecapellett Год назад

      Well, I fixed by using axios.. it seems the fetch api had a bug of some sort

  • @inteliconn995
    @inteliconn995 Год назад

    Thanks!

  • @JamesSantos-n8l
    @JamesSantos-n8l Год назад

    Thank you for the video :)
    Just wondering, how did you configure your "rfc" emmet without the react import :/

  • @bopang1127
    @bopang1127 11 месяцев назад

    Nice lessson .
    But when I fetch wikipedia api got an error
    Internal error: TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

  • @samiullahsheikh5015
    @samiullahsheikh5015 Год назад +1

    please make a video on public and private routes so only authenticated and authorized user can visit a particular page

  • @maruf-procode
    @maruf-procode Год назад

    Hello, I am facing problems using next 13 app directory with antd, antd styles are not loading on initial load. how to solve the issue can you please help me?

  • @sawsoe3371
    @sawsoe3371 Год назад

    Great videos about next.js 13 and I love all your videos. I been stuck on getting uncaught SyntaxError "undefined" after adding and testing client component. I trying to find the solution and still can't find it. Can you help me, sir?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      Likely an issue with version 13.3. I recommend going to version 13.2.4 and trying again. At the terminal: npm i next@13.2.4

  • @Su47Goldeneagle
    @Su47Goldeneagle Год назад

    Thank you so much for the tutorial Dave. Can you tell me what VS Code plug-in are you using at 6:07 that highlights the scope of a parentheses or a bracket ?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      Here is how to do that: ruclips.net/user/shortsMDaxWffMjrQ

    • @Su47Goldeneagle
      @Su47Goldeneagle Год назад

      @@DaveGrayTeachesCode thank you very much for taking the time to reply my question.

  • @rr2r2r2ra
    @rr2r2r2ra Год назад

    Hello Dave, why do I get this when I add "use client"; at the very top of my page.tsx
    Unhandled Runtime Error
    SyntaxError: "undefined" is not valid JSON

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      A couple of possibilities. 1) You are using version 13.3 and it is still a bit buggy - so try rolling back to 13.2.4. ..or 2) You really do have an undefined value you are trying to get JSON from.

    • @kenthefley2226
      @kenthefley2226 Год назад

      @@DaveGrayTeachesCode The temporary solution is to use an arrow function.

  • @Shubham-h1z
    @Shubham-h1z Год назад +1

    Dave, I am not able to see the results on my page. If anyone else can help, please do help.

  • @DunckingTest
    @DunckingTest Год назад +1

    can you make auth system with express js and nextjs with refresh tokens and server side rendering + using rtk query for fetching some data

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      Thanks for the request! I may get into the API part of Next.js as well. I'm not sure why you would want to use RTK Query here as Next.js does a great job with the cache and deduping requests.

    • @DunckingTest
      @DunckingTest Год назад

      @@DaveGrayTeachesCode i think in order to fetch data from an api you need some sort of query library to query data does next js has its own solution for that?

  • @richardramirez5746
    @richardramirez5746 Год назад

    Hey Dave, 'use client' directive is currently useful? I am new to NextJS. When using or not using that directive, component looks like rendering in the server and hydrating in the client, and not as explained by NextJS docs (they say client components only render on the client as if it were pure React) I can notice this by using console.log() into the component before the return statement, and I can notice that the printing is produced both in my terminal and in the browser! Thanks for your attention.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      "use client" makes Next.js create a client component. If you have any type of interactivity in the component, this is what you need. They are very useful and are essentially React components.

  • @psyferinc.3573
    @psyferinc.3573 Год назад

    hahah i love your choice iin musicians. please what is your favourite zappa song?

  • @mrbilchalan
    @mrbilchalan Год назад +1

    Superb, superb. Thank you again. But I can not practice it. After installation when I start my app with npm run dev, it immediately stop after start without any error or waring. I install various node and next version, even try to run your project, its always given the same result. I feel like a fool. Even stackoverflow didn't help me. Some of them tell me to change version of node and next. Can you help me?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +2

      You're welcome. All I can suggest is to go back to the first video in this series and follow the step by step instructions that I show in the video for installation. This video also starts from scratch with a Next.js project, but I do not show installing Node.js here.

  • @frostyfreezemovies
    @frostyfreezemovies Год назад +1

    Idk why my html tags all are behaving default whether using h1 or div all are showing same(
    are not working after installing tailwindcss )

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      You must apply Tailwind styles. Otherwise, they will all look the same. If you haven't worked with Tailwind before, this is expected.

  • @cesarreyes7019
    @cesarreyes7019 Год назад

    I was planning on making a different website for practice with a different api, how would I get the search params for the website with the api? or if easier, how did you get the params for the wiki api.
    ps thank you for the hours of content you have provided me 🎉

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      You're welcome! You need to look at the documentation for whichever API you want to use. They are all different.

  • @mrfran1
    @mrfran1 Год назад

    in case there was no button alongside the search input but instead the input's onChange will trigger the api request adding a debounce to the input would be necessary?

  • @madfoodhunter
    @madfoodhunter Год назад +1

    is it the last video of next js , please reply sir !

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      I always try to reply. Sometimes a bit overwhelmed. Answer: No, there will be more.

  • @sudhanshusharma9159
    @sudhanshusharma9159 Год назад

    Error while keeping Search componet inside Navbar, It deos not allow in 13.0 next version. Could not find fix, can u help?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      Check the package.json file I have for that lesson and consider installing that version of Next.js instead of the "@latest" version with the npm command. 13.3 was just released yesterday and it is buggy. If you just installed today, that's what you have.

  • @chamaraweerasinghe3909
    @chamaraweerasinghe3909 Год назад

    grate content

  • @jakubfadkowski4927
    @jakubfadkowski4927 Год назад

    Hey, not sure whether i'm right but isn't it better to use nextjs Image component in our Item component instead of `default` img or it would be `overkill` in that simple project? Thank you in advance!

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      I think I mention in the video that you could, but here - especially pulling in small thumbnail images from Wikipedia - it is easier to just use the img element. That said, in a later project I do show how to pull images from another domain which requires some settings in your next.config.js file, too.

    • @jakubfadkowski4927
      @jakubfadkowski4927 Год назад

      thanks for the answer!

  • @artursradionovs9543
    @artursradionovs9543 Год назад

    I am unsure why, but my server side rendering is not working. Could that be because Redux Store Provides an entire app?
    So I am still struggling to convert my NextJS 12 app into ver 13

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      So many details in your code that no one else knows, but in general, Redux is state management in the client. It should not impact your SSR.

  • @sudhanshusharma9159
    @sudhanshusharma9159 Год назад

    13.3 ask tailwid while installation itself. What is happening with React/next?

  • @6little6fang6
    @6little6fang6 Год назад

    I am not sure but cant you just have your app folder inside the src/ folder?

    • @ben7385
      @ben7385 Год назад

      yes, app will be in the src folder when you select src folder during setup

  • @安全保密
    @安全保密 Год назад

    The small project came at the right time, and a whole bunch of fundamental concepts can make the bravest of men depressed.

  • @nademkhan931
    @nademkhan931 Год назад

    I'm assuming all of the above is still valid for 13.4

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад

      I recommend checking my package.json file for each video in this series and using the version of Next.js that I use in the video to avoid anything unexpected. Some versions have more bugs than others.

  • @nobodyads
    @nobodyads Год назад +1

    Bro next let Angular . pls

  • @VasylBatih
    @VasylBatih Год назад

    hi, thanks for lessons
    but on me link type "en.wikipedia.org/?cruid=${result.pageid}" don`t work
    but worked "en.wikipedia.org/wiki/${result.title}" it`s ok ?