Introduction to Next.js and React

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ค. 2024
  • A hands-on introduction to the main Next.js and React concepts by building and deploying a real application.
    0:00 - Introduction
    0:29 - Requirements
    2:24 - Package Managers
    4:45 - Running Locally
    6:33 - Fast Refresh
    6:57 - Routers
    7:57 - React
    8:44 - JSX
    10:14 - Components
    11:15 - Props
    12:25 - Composing
    14:08 - Imports and Exports
    15:36 - External Components
    17:05 - Create Next App
    19:09 - Directory Overview
    21:57 - Layouts and Pages
    26:36 - Routing
    27:43 - Dynamic Routes
    28:36 - next/link
    30:34 - Reading Route Parameters
    31:48 - Nested Layouts
    33:51 - Installing Postgres
    35:15 - Async Components (Data Fetching)
    40:53 - Suspense + Caching
    43:58 - Styling
    48:16 - Quiz Pages
    51:01 - Database Schema
    51:49 - Displaying Quiz Answers
    54:29 - Displaying Correct Answer (Server Action)
    1:01:44 - Creating New Quizzes (Forms)
    1:14:40 - Revalidating Data
    1:17:04 - Deploying to Vercel
    1:20:21 - Conclusion
    Here are some additional resources:
    - Next.js Courses: nextjs.org/learn
    - React Course: react.dev
    - Me: leerob.io
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 144

  • @_ash64
    @_ash64 7 หลายเดือนก่อน +74

    I would say this could probably be the best intro to Next.js on YT. Bc this is coming from someone who really knows how Next is built on top of the React library!

  • @huuphongsan
    @huuphongsan 7 หลายเดือนก่อน +7

    After 3 years, I just want to say thank you Next.js and Vercel for changing my life.

  • @kevinjhammond
    @kevinjhammond 6 หลายเดือนก่อน +3

    Dude I just paused at 12 and a half minutes to comment on how thankful I am to find this video. It is the explanation I have been searching for as someone who is trying to understand this tech stack. Thank you so much!

  • @gvenkatakrishnan125
    @gvenkatakrishnan125 7 หลายเดือนก่อน +1

    Excellent. Thanks Lee. Please do this kind of video from time to time

  • @jitx2797
    @jitx2797 7 หลายเดือนก่อน +3

    Good to see this course Lee. I started learning React because of your course only. You are awesome :)

  • @Wheeelie402
    @Wheeelie402 7 หลายเดือนก่อน +2

    I just got the pop up notification that you released this video. Immediately, I clicked on it with a “this is too good to be true”, and yet, Lee, here we are. Thank you! Let’s go.

  • @ayoolafakoya9841
    @ayoolafakoya9841 7 หลายเดือนก่อน +6

    Excellent tutorial.
    Really enjoyed the clear explanations and demonstrations.
    I'd love to see more content from you, especially diving into intermediate to advanced topics.
    It would be immensely helpful if you could provide examples of real-world applications to accelerate our understanding and application of these concepts. Looking forward to the next video. 👍

  • @cusematt23
    @cusematt23 6 หลายเดือนก่อน +1

    You did a really phenomenal job with this. Like legitimately you cleared up 10+ things I was still totally confused about after having watched probably over 1000 YT vids on web dev. And they were not even the main topic of your video. Salud.

  • @imAskja
    @imAskja 7 หลายเดือนก่อน +2

    Lee, your videos always help me tremendously. This one is no exception. Thank you!

    • @leerob
      @leerob  7 หลายเดือนก่อน +1

      Appreciate it!

  • @bulelaniponer
    @bulelaniponer 7 หลายเดือนก่อน +7

    Awesome intro Lee, very refreshing from the ground-up explanation. Keep up the awesome work as always 🥷

    • @leerob
      @leerob  7 หลายเดือนก่อน +3

      Appreciate it 😁

    • @codelivewithme
      @codelivewithme 7 หลายเดือนก่อน +1

      ​@@leerobit'll be whole videos series or just one video

  • @jatinlodhi980
    @jatinlodhi980 7 หลายเดือนก่อน +1

    Lee please make few more videos like this, this is amazing small project and explanation

  • @saadowain3511
    @saadowain3511 6 หลายเดือนก่อน

    Thanks Lee. So many concepts in a short tutorial time.

  • @78SuperWhite
    @78SuperWhite 7 หลายเดือนก่อน +16

    Any chance of a tutorial/guide on how you set up your Postgres DB?

  • @codewithguillaume
    @codewithguillaume 7 หลายเดือนก่อน +2

    This tutorial is DOPE !

  • @leanamaro
    @leanamaro 7 หลายเดือนก่อน

    Excellent tutorial! thank you very much! it helped me in the transition from pages router and postgrade.

  • @KristianTheDesigner
    @KristianTheDesigner 7 หลายเดือนก่อน

    I started learning Next.js last tuesday (I know React quite well from before). I have done one very small project on my own in my own way, now i will do this and learn the "correct" way 🤓 30min in and it is really great and i can tell already that i feel more comfy with Next.

  • @gurjotsinghpandher3908
    @gurjotsinghpandher3908 11 วันที่ผ่านมา

    Excellent -- covered everything so nicely... best video ever!!!

  • @sahaneakanayaka3394
    @sahaneakanayaka3394 7 หลายเดือนก่อน +1

    Love this one , everything is crystal clear 😍😍🙏👌

  • @Grolliiitjk
    @Grolliiitjk 7 หลายเดือนก่อน +1

    Holy moly, a big thanks for this tutorial! I currently have a fairly large website with around 3,000 daily visitors that was built by a freelancer. However, I want to learn how to manage it on my own so that I can add new features and updates. I'm going to grab a cup of coffee and watch this now. thanks again!

    • @leerob
      @leerob  7 หลายเดือนก่อน

      If you have any questions, please let me know!

  • @lfgraf
    @lfgraf 7 หลายเดือนก่อน

    Overwhelmed with gratitude for Lee

  • @sayanmanna2511
    @sayanmanna2511 7 หลายเดือนก่อน +1

    hey man, this is really an awesome intro!!!

  • @julientavernier1174
    @julientavernier1174 5 หลายเดือนก่อน

    Amazing intro ! 😍

  • @juancarlosqr
    @juancarlosqr 7 หลายเดือนก่อน

    Exceptional!! Thanks

  • @pHscLoq
    @pHscLoq 6 หลายเดือนก่อน +1

    Very good video again by you, thank you for being a good educator. Also I think you need to make a video like this (or maybe more complex project but again explaining the features) again with the new features; it would be very nice. Also, I have always had a problem understanding authentication and separating Next.js and React. After learning React from the docs, as recommended, I chose a framework: Next.js. But now, I'm not sure if I can say I know React. I've always built projects with Next.js, but I started to doubt if I can apply for jobs that are looking for a React developer.

  • @theintjengineer
    @theintjengineer 7 หลายเดือนก่อน

    That url redirect with the query parameter `?show=true` was slick haha

  • @abdullahinafiu6040
    @abdullahinafiu6040 7 หลายเดือนก่อน

    This the best. Next.js course, love it
    Hope one day, you will decide to write a book on Next.js

  • @CraigWilsonMusic
    @CraigWilsonMusic 3 หลายเดือนก่อน

    Great tutorial, thank you!

  • @TheDigitalDam
    @TheDigitalDam 7 หลายเดือนก่อน

    Love this!

  • @SergioBarreracoding
    @SergioBarreracoding 5 หลายเดือนก่อน

    Great video, Lee! That was a great refresher back into how much server components help facilitate a fast and well structured MVP for any demo purposes, plus the excellent addition of postgres, revalidation and a well-performant UI. I'd like to see up next a demo of the `next-backend`, where it is abstracted out of the jsx, independent to add any rest endpoint to our client requests. I will try this `next-backend` out myself and maybe replace a known-in-the-field-backend(i.e. Django, SpringBoot). I'm interested in your thoughts. Thanks!

  • @MadisonKanna
    @MadisonKanna 7 หลายเดือนก่อน

    this is awesome!

  • @GiovanniOrlandoi7
    @GiovanniOrlandoi7 4 หลายเดือนก่อน

    Great video!

  • @biLLie_wiLLie
    @biLLie_wiLLie 7 หลายเดือนก่อน +2

    I watched it full. Great tutorial!

    • @27sosite73
      @27sosite73 7 หลายเดือนก่อน +2

      😂

    • @leerob
      @leerob  7 หลายเดือนก่อน +6

      @@27sosite73 Watched at 10x speed 😂

  • @timomartinson
    @timomartinson 7 หลายเดือนก่อน

    sharp as always, :-)

  • @keyboardbasher5769
    @keyboardbasher5769 7 หลายเดือนก่อน

    awesome tutorial! got me back into sql after using firebase for the longest time lol

  • @WuRicardo-up6tx
    @WuRicardo-up6tx 2 หลายเดือนก่อน

    Thanks a lot!It helped me~

  • @dharmeshgohil9375
    @dharmeshgohil9375 7 หลายเดือนก่อน

    awesome tutorial keep it as simple as possible

    • @leerob
      @leerob  7 หลายเดือนก่อน

      Thank you!

  • @ranu9376
    @ranu9376 3 หลายเดือนก่อน

    AMAZING!!!!!

  • @francisera1
    @francisera1 3 หลายเดือนก่อน

    nice one lee

  • @harsh07may
    @harsh07may 7 หลายเดือนก่อน +5

    Hi Lee, Great video as usual.
    Can you try to make an Authentication in NextJS tutorial aswell ? Would really appreciate it.

  • @shinchanaddicts3572
    @shinchanaddicts3572 7 หลายเดือนก่อน

    Sir is this a single video or a playlist either way you are best ❤

  • @emretrn
    @emretrn 7 หลายเดือนก่อน

    Great video, Lee! Thanks for the amazing content. I wonder what is the theme that you are using? 👀

  • @devinleggett
    @devinleggett 5 หลายเดือนก่อน

    Your videos are great! Thanks for sharing. Any chance you’d share a link to the camera you use? Production quality is on point.

  • @mattz_zeref
    @mattz_zeref 7 หลายเดือนก่อน

    i'm here to like the awesome video

  • @shendrong3695
    @shendrong3695 7 หลายเดือนก่อน

    next ecommerce template deserve video like this

  • @destocot1729
    @destocot1729 7 หลายเดือนก่อน +5

    can you share the code for setting up postgres tables to follow along?

  • @Ilcohere
    @Ilcohere 7 หลายเดือนก่อน

    How many introductions there are to React nowadays really tells how defunct the community is actually.

  • @maduemeka6982
    @maduemeka6982 7 หลายเดือนก่อน

    My hero🎉🎉🎉🎉

  • @faizanahmed9304
    @faizanahmed9304 7 หลายเดือนก่อน +2

    Thanks for the tutorial Lee. Can you increase the font size of your code editor? Thank you!

  • @hd_1761
    @hd_1761 7 หลายเดือนก่อน +1

    Hey Lee great vedio watched from start to end with hand on practice. Can u plz tell which Extensions u are using for nextjs seems like writing code is much easier with it.

  • @zksumon847
    @zksumon847 7 หลายเดือนก่อน

    I'm a beginner. Just what i was looking for.

  • @Sorkstryparen
    @Sorkstryparen 7 หลายเดือนก่อน

    Lee is the king 👑

  • @Systemv1
    @Systemv1 5 หลายเดือนก่อน

    Great; thank you!
    Zooming the UI in though would be fantastic. It's very difficult to see on mobile 🙂

  • @yashguma
    @yashguma 7 หลายเดือนก่อน

    Yes

  • @landsman737
    @landsman737 7 หลายเดือนก่อน

    This way of querying the database feels like 15 years ago, when we used to do those insecure raw queries in PHP. 👀 I expected that I would never see them again. The same applies to the MVC design pattern.

  • @1weiho
    @1weiho 5 หลายเดือนก่อน

    Hey Lee, what is your VS Code theme? It looks so nice! It would be great if you could make a video showcasing your VS Code and terminal setup haha 👾

  • @mdsaifulislamshanto4444
    @mdsaifulislamshanto4444 7 หลายเดือนก่อน

    Great

  • @muratyasar
    @muratyasar 4 หลายเดือนก่อน

    lovely content Lee! Now all the pieces finally clicked into place for an iOS dev trying to learn next. What is the auto completion tools name btw? Anyone knows what tool/ai it is that fills suggestions smartly

  • @subem81
    @subem81 7 หลายเดือนก่อน

    Nice. Thanks for this Lee!
    So when is React2028 / NextJS2028 being released? I'm ready for another BA Lee Robinson free course!😂

  • @chandima94
    @chandima94 6 หลายเดือนก่อน

    Mind explaining how you did the pnpm install for those who don't know the shortcuts?

  • @t1ltrides
    @t1ltrides 7 หลายเดือนก่อน +2

    Hi Lee! Amazing tutorial! Learned a lot of new things despite having worked with React and Next.js! I have one question: at 1:16:52 you talked about clearing out the form on submission, but I'm confused as to how you would do that as we aren't using any client-side state. I feel like I'm missing something here and would love to hear your thoughts on this. Thank you!

    • @leerob
      @leerob  7 หลายเดือนก่อน +1

      github.com/leerob/leerob.io/blob/54c6c4ff68297a54dbf965ef08f7fd256daac2fb/app/guestbook/form.tsx#L16

    • @t1ltrides
      @t1ltrides 7 หลายเดือนก่อน

      @@leerob thank you!

  • @guilhermedavid3232
    @guilhermedavid3232 7 หลายเดือนก่อน

    Hello Lee, I'm Guilherme, I have some questions about the Next.Js caching system.
    1 - Do data searches using fetch with the Authorization header invalidate the cache?
    2 - If I have a static rendered page at the time of build, is it possible to revalidate its data fetch with the revalidate option?
    3 - When using the fetch revalidate option, if I pass a value like 60 * 10, is it a valid value?

  • @danieliski36
    @danieliski36 7 หลายเดือนก่อน

    I'm a beginner I have some questions tho, if someone can answer it I really appreciate it, Idk how works the server "side " with the database conection, I mean in the video you show us how to implement it but how can I do it in the right way? I am confuse about that but overall it was a great video, I learned a lot, thanks.

  • @mystickago
    @mystickago 5 หลายเดือนก่อน

    soo good but the database part i didnt know how to go about things

  • @randomforest_dev
    @randomforest_dev 7 หลายเดือนก่อน

    This is like my early days of PHP coding :D. No offense, I use Next.js all my projects. May be in the future, there will be models, views and controllers in Next.js full-stack project.

    • @landsman737
      @landsman737 7 หลายเดือนก่อน

      exactly mine feelings

  • @kenlee6434
    @kenlee6434 6 หลายเดือนก่อน

    The cursor movement is very smooth, how is it achieved?
    光标移动很顺滑,怎么做到的?

  • @asadjakhar6618
    @asadjakhar6618 2 หลายเดือนก่อน

    @Lee_Robinson which VS Code extensions you are using?

  • @wadallace
    @wadallace 7 หลายเดือนก่อน

    Was attempting to follow along but when it got to the database section, I got a bit lost - is there a file you can reference for the database you used for the quiz information?

  • @nicobobb
    @nicobobb 7 หลายเดือนก่อน

    How to make protected route in next js 14?

  • @kirso
    @kirso 7 หลายเดือนก่อน

    Can we expect a svelte/kit version of this?

  • @ZweL2001
    @ZweL2001 7 หลายเดือนก่อน

    Could someone please mention the vscode theme Lee used.

  • @chi-mf1cx
    @chi-mf1cx 7 หลายเดือนก่อน

    GR8

  • @tawsifhaque9360
    @tawsifhaque9360 7 หลายเดือนก่อน +3

    @lee what vscode theme do you use?

  • @ashimov1970
    @ashimov1970 7 หลายเดือนก่อน

    'touch' command works for Windows as well, dude

  • @gauravsharma597
    @gauravsharma597 7 หลายเดือนก่อน

    Great video Lee, can you bring more content on APIs with nextjs, I am not getting this with documentation.
    thanks..

    • @leerob
      @leerob  7 หลายเดือนก่อน

      Are you using Server Actions? They can replace most usage of writing API endpoints manually in Next.js now.

    • @gauravsharma597
      @gauravsharma597 7 หลายเดือนก่อน

      ​@@leerob One more request Lee, can you bring a video on CSR, SSR ("use client", "use server" ) , how they are different. Still not getting this..
      thanks

  • @dewanmohammademon
    @dewanmohammademon 7 หลายเดือนก่อน

    if we are get a tutorial mongodb with next.js .Its would be very helpful for us .

  • @jijieats
    @jijieats 7 หลายเดือนก่อน

    I think this guy knows a thing or two about React and Next.js

  • @kishanbsh
    @kishanbsh 6 หลายเดือนก่อน

    How to do file uploads?

  • @toromanow
    @toromanow 5 หลายเดือนก่อน

    What coding assistant were you using in this video?

    • @AlexWebLab
      @AlexWebLab 3 หลายเดือนก่อน

      Copilot

  • @nikako1889
    @nikako1889 6 หลายเดือนก่อน

    which vscode theme do you use?

  • @omkarsheral8559
    @omkarsheral8559 5 หลายเดือนก่อน

    Which service did you use for online DB?

    • @leerob
      @leerob  5 หลายเดือนก่อน +1

      Neon, which is integrated into Vercel!
      vercel.com/docs/storage/vercel-postgres

  • @user-wu3vi3bj1u
    @user-wu3vi3bj1u 7 หลายเดือนก่อน

    Hello Lee. I use the previous months' NextJs. However, I'm still unable to fully comprehend how NextJs' new features handle APIs. Could you thus create a tutorial for the Next API routes using various user inputs, submit a request, and receive a response?

    • @leerob
      @leerob  7 หลายเดือนก่อน

      Hey! Did you make it through this video to where I talk to server actions?

  • @nickpiraino3781
    @nickpiraino3781 6 หลายเดือนก่อน

    do you have a course I can take?

  • @toromanow
    @toromanow 5 หลายเดือนก่อน

    I find it very confusing that the files in different directories have the same names: page.tsx, layout.tsx.

  • @ruy.monteiro
    @ruy.monteiro 7 หลายเดือนก่อน

    20:30 No Tailwind config in the future? 👀

    • @leerob
      @leerob  7 หลายเดือนก่อน +1

      This is something Tailwind is working on! tailwindcss.com/blog/2023-07-18-tailwind-connect-2023-recap#:~:text=We%E2%80%99re%20making%20Tailwind,postcss%2Dimport.

  • @ikbo
    @ikbo 6 หลายเดือนก่อน

    does vercel run on aws or google cloud?

  • @codedusting
    @codedusting 7 หลายเดือนก่อน

    Using both routes is pointless and I didn't like how the important key point on that is skipped. That the window refreshes between pages and app routers making it impossible to migrate an enterprise app to a new router gradually.

  • @kevinoyunda
    @kevinoyunda 7 หลายเดือนก่อน

    1:07:46 nice voice

  • @prashlovessamosa
    @prashlovessamosa 7 หลายเดือนก่อน

    Please make part 2 please.

    • @leerob
      @leerob  7 หลายเดือนก่อน

      What would you like to see in part 2?

    • @zhiven7484
      @zhiven7484 7 หลายเดือนก่อน +1

      @@leerob Error handling for calling api please

    • @ayoolafakoya9841
      @ayoolafakoya9841 7 หลายเดือนก่อน

      Check out server actions @@zhiven7484

    • @prashlovessamosa
      @prashlovessamosa 7 หลายเดือนก่อน +1

      ​@@leerobHow to optimised and make our NextJS app faster.

  • @yasyaindra
    @yasyaindra 6 หลายเดือนก่อน

    1:10:52

  • @user-rd1jm5om3f
    @user-rd1jm5om3f 7 หลายเดือนก่อน

    Hi Lee. Greetings. Can you please make a super powerful video on authentication and authorization ( included email validation and verification) from scratch in Next.js without using any auth providers like nextAuth or clerk? Please Lee

    • @leerob
      @leerob  7 หลายเดือนก่อน

      Yeah! For now, I have a version of NextAuth working here github.com/leerob/leerob.io

  • @y9uta
    @y9uta 7 หลายเดือนก่อน

    Tweet Id is not working for me

  • @mrthegamergp
    @mrthegamergp 7 หลายเดือนก่อน

    It's been difficult for me to understand where and when I should use the server component

    • @leerob
      @leerob  7 หลายเดือนก่อน

      It depends on what you're trying to build, but most of the time, starting with a server component makes sense (hence the default). But for some client, interactive things, you'll want client components. Client components are not a bad thing either :) Both are okay.

  • @destocot1729
    @destocot1729 5 หลายเดือนก่อน +4

    heres a postgres query yall can use to seed the data
    -- reset
    -- DROP TABLE answers;
    -- DROP TABLE quizzes;
    CREATE TABLE IF NOT EXISTS quizzes (
    quiz_id SERIAL PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    description TEXT,
    question_text TEXT NOT NULL,
    created_at TIMESTAMPTZ DEFAULT NOW()
    );
    CREATE TABLE IF NOT EXISTS answers (
    answer_id SERIAL PRIMARY KEY,
    quiz_id INT REFERENCES quizzes(quiz_id) ON DELETE CASCADE,
    answer_text TEXT NOT NULL,
    is_correct BOOLEAN NOT NULL
    );
    INSERT INTO quizzes (title, description, question_text)
    VALUES
    ('Programming Quiz 1', 'A quiz about programming concepts', 'What is a variable?'),
    ('Programming Quiz 2', 'Another quiz about programming concepts', 'What is the most common loop construct in programming languages?'),
    ('Programming Quiz 3', 'Yet another quiz about programming concepts', 'What is the main difference between a compiler and an interpreter?'),
    ('My Quiz', 'A quiz about geography', 'What is the capital of Brazil?');
    INSERT INTO answers (quiz_id, answer_text, is_correct)
    VALUES
    (1, 'A container for storing data.', true),
    (1, 'A programming language.', false),
    (1, 'A mathematical operation.', false),
    (2, 'For loop', true),
    (2, 'While loop', false),
    (2, 'Do-while loop', false),
    (3, 'A compiler is faster, while an interpreter is more flexible.', false),
    (3, 'There is no real difference, they both achieve the same outcome.', false),
    (3, 'A compiler generates machine code, while an interpreter executes the code line by line.', true),
    (4, 'Rio de Janeiro', false),
    (4, 'Brasilia', true),
    (4, 'São Paulo', false);

    • @parrurox01
      @parrurox01 3 หลายเดือนก่อน

      thanks a lot mate

    • @AlexWebLab
      @AlexWebLab 3 หลายเดือนก่อน

      The capital of Brazil is Brasilia though. The most common loop is the For loop. Peace.

    • @destocot1729
      @destocot1729 3 หลายเดือนก่อน +1

      @@AlexWebLab it was all mr. gpt man I swear 😅

    • @destocot1729
      @destocot1729 3 หลายเดือนก่อน +1

      Made the edits

    • @AlexWebLab
      @AlexWebLab 3 หลายเดือนก่อน

      @@destocot1729In any case, thank you so much. It has been very useful. ❤

  • @kim92se64
    @kim92se64 4 หลายเดือนก่อน

    20

  • @HfvTdg
    @HfvTdg 5 หลายเดือนก่อน

    The font is so small in your vs code that not useful 😢

  • @tamsssss6765
    @tamsssss6765 7 หลายเดือนก่อน

    do you offer paid coaching?😅😬

  • @zunnoorainrafi5985
    @zunnoorainrafi5985 7 หลายเดือนก่อน

    I don't like how we handle loading state in server actions by making a separate component as compare to Remix where we use useNavigation() hook to handle loading states of forms.

  • @squirrelingaround
    @squirrelingaround 4 หลายเดือนก่อน

    this is an overcomplicated nightmare. the fact i have to install everything manually and set up the whole structure of the project manually when we have things like Vitejs is just outstanding how the web development field is crap and full of snobs pushing the new shiny thinhgs even tho is absolute crap.

  • @wriddhihazra
    @wriddhihazra 7 หลายเดือนก่อน

    This is the equivalent of Mozart uploading a tutorial on how to compose classical music on TH-cam

  • @27sosite73
    @27sosite73 7 หลายเดือนก่อน +1

    first nah

    • @leerob
      @leerob  7 หลายเดือนก่อน +1

      👀

    • @27sosite73
      @27sosite73 7 หลายเดือนก่อน

      ​@@leerob Hey, could you tell us if Vercel/React is working on some sort of AI assistant embedded in Next.js/React.js that can generate high-quality code? After watching the Fireship video, I had a significant discussion with friends about this. =( What would you say?