How NextJS REALLY Works

Sdílet
Vložit
  • čas přidán 8. 10. 2022
  • NextJS is probably the best way to build your next React application. There are few better ways to do full stack with Javascript. Hopefully this video helps you better understand why!
    THANK YOU MIR FOR THE GRIND TO GET THIS OUT TODAY!!!
    ALL MY CONTENT IS FILMED LIVE ON TWITCH AT / theo
    ALL MY BEST MEMES ARE ON TWITTER FIRST / t3dotgg
    ALL THE COOLEST PEOPLE ARE IN MY DISCORD t3.gg/discord
    ALL MY VIDEOS ARE POSTED EARLY ON PATREON / t3dotgg
    Everything else (instagram, tiktok, blog): t3.gg/links
  • Věda a technologie

Komentáře • 164

  • @asiraky
    @asiraky Před rokem +215

    As someone who’s been mildly critical of some of your videos, this video is spot on. I’m sick of explaining what you just explained here, and I’m going to direct people here from now on.

    • @iGhostr
      @iGhostr Před rokem +3

      same

    • @huebdoo
      @huebdoo Před 8 měsíci

      Yeah .. Im an SEO guy trying to explain how to deploy JS correctly ... this makes my work with engineering teams a lot easier ... thank you!

  • @Johnson-ks5uw
    @Johnson-ks5uw Před rokem +8

    I love your style of explaining and you really seem to know what you are talking about, including all the other videos you made about next. You saved me probably tons of hours of research and I am really thankful for that!

  • @gabrielwest2584
    @gabrielwest2584 Před rokem +17

    You dropped this video at the perfect time! My team is starting a new application and we're considering nextjs and this was an awesome introduction :)

  • @itzfinners7458
    @itzfinners7458 Před rokem +7

    Loving the new production style of video editing Theo! Just the inclusion of a "Coming Up" section is a great addition!

  • @matthewvalentine9961
    @matthewvalentine9961 Před rokem +46

    at this point of my development journey ( very new here , self taught 8 ish months in ) . your content is exactly what i needed, thank you!
    it feels like this is a conversation/explanation that i would have or want to have when apart of a team. very much “in the field” vibes. helping tie in the knowledge of tools & how to think of developing with them !
    stay safe. thanks again !

  • @abel090713
    @abel090713 Před rokem

    I missed like half of this live video so glad the video came out, this might be a personal favorite

  • @ShiloBuff
    @ShiloBuff Před rokem

    This is amazing depth and details. Right down my alley. I like your style. Thank you.

  • @NikitaLipkanovOfficial

    Love the explanation about that! Thanks for clarifying!

  • @phucnguyen0110
    @phucnguyen0110 Před rokem

    ty Theo, just what I needed since I've been playing with Next a lot these days.

  • @faizanahmed9304
    @faizanahmed9304 Před rokem +1

    That is a beautiful explanation, thank you, Theo!

  • @shivamjhaa
    @shivamjhaa Před rokem

    Hey Theo. Great video as always. Can you make a video regarding what libraries/ packages are you using at ping to solve problems that you faced?

  • @samuelgunter
    @samuelgunter Před rokem +17

    14:00 The card preview has been disabled for everyone since April 2022 because the styling of the validator was different from the actual website

    • @doritoflake9375
      @doritoflake9375 Před rokem +1

      Thanks for sharing! I suddenly started seeing this as well recently on my sites and was wondering what broke lol

    • @t3dotgg
      @t3dotgg  Před rokem +4

      This is super good to know thank you

  • @teosurch
    @teosurch Před rokem

    Thanks a lot. So good to learn this things not by using documentation, but by watching nice CZcams channel with a cup of tea :)

  • @JavierPortillo1
    @JavierPortillo1 Před rokem +4

    Thanks Theo!! I've been reluctant to adopt Next and other SSR tools because I didn't understand them. Now that I've heard your explanation I can see how cool Next is 👍

    • @kolega1999
      @kolega1999 Před rokem +3

      I was the same man, then I tried it and found out that it is actually kind of a wrapper around your React application which lets you render portions of it on the server. It can seem as a lot when you read or hear about it, but when you actually start building with it following the docs, it all makes sense and it's not nearly as complicated as I thought before. Having a kind of solid understanding of React helps though, you can then easily differentiate Next from React parts.

  • @artemiygolden2853
    @artemiygolden2853 Před rokem +18

    The best lectures I've seen were given by professors using a blackboard. It just occurred to me that you archive the same greatness by using Excalidraw!
    Amaizingly clear and useful content! Thanks a lot!

  • @DennisHorn1981
    @DennisHorn1981 Před rokem

    This is absolutely important background-knowledge! Fantastic explanation! Thank you! 😀👍

  • @giovannicostantini6269

    You're an amazing person!
    Great quality content

  • @mohamedhassenetetbirt6841

    Amazing work, helped me fix small confusions

  • @MehediHassan-pn5uc
    @MehediHassan-pn5uc Před rokem

    Really Love All Your Videos ❤️

  • @dipneupane3179
    @dipneupane3179 Před rokem

    You explained it so easily. Thanks for the effort.

  • @mtin79
    @mtin79 Před rokem +3

    Awesome, would love the same for remix run!

  • @sarmunbustillo9217
    @sarmunbustillo9217 Před rokem

    Uff what an explanation! Really good video!

  • @berkaycirak
    @berkaycirak Před rokem

    Thanks for sharing, you have mentioned that when browser requests to next server, next will execute getServerSideProps and then react will use those props. However, we can use getStaticPaths function to serve all dynamic routes pre-rendered HTML in built time. In that case, when a user requests to next server, will next server execute some react or just sending the pre-rendered HTML in built time instead of runtime?

  • @georgekrax
    @georgekrax Před rokem +1

    We needed a video like this 🙏

  • @victorbrown3155
    @victorbrown3155 Před 7 měsíci +1

    We really need this for app router as well. Especially how navigation works!

  • @robgioeli
    @robgioeli Před 9 měsíci

    The intro music and clip-of-content before the explanation video starts is gold. You should start doing this again.

  • @paulyi9365
    @paulyi9365 Před rokem +6

    Great video as always! I’ve only been working as a software eng for two years, so I’m always listening to your VODs!
    I was wondering if you could talk about mobile app development a bit more in depth (I saw your Code Wars working with Flutter, but I’d love to see you take a deep dive on React Native)

  • @anuragk6722
    @anuragk6722 Před rokem

    awesome video, wondering which software you use to record the screen and your face?

  • @elhaambasheerch7058
    @elhaambasheerch7058 Před rokem

    Great video! You just earned a sub theo.

  • @faraonch
    @faraonch Před rokem

    Thanks for this. Will just send it to all my colleagues who are asking me over and over again why I almost always choose NextJS. The cons are no cons, as I can opt out easily but still getting all the benefits especially as you mentioned the f##!@# developer experience, live reload and the option to have everything without hacking it on my own.

  • @FernandoJaramillo-jw7nm
    @FernandoJaramillo-jw7nm Před 4 měsíci

    Very nice explanation, Thank you...!

  • @mmgordion
    @mmgordion Před rokem +9

    You forgot to mention that because of nextjs's server we can also create a minimal backend api, which is extremely useful for small fullstack projects. It is also something that only nextjs has, comparing to vite and CRA.

  • @eliuddyn
    @eliuddyn Před rokem

    Amazing explanation 🔥🔥

  • @joepetrillo6185
    @joepetrillo6185 Před rokem

    How does NextJS handle links to other pages? Will the page its going to act like a normal react app (instant switch) if there is no server side rendering? What if the page its going to is static?

  • @ragnarlothbrook8117
    @ragnarlothbrook8117 Před 10 měsíci

    awesome video! Thanks 👍🏻

  • @JoelMathewmatgoogle
    @JoelMathewmatgoogle Před rokem +1

    Thank you for this!

  • @austincodes
    @austincodes Před rokem

    One of the huge things that is overlooked with nextJs is the build tools

  • @user-ge2vc3rl1n
    @user-ge2vc3rl1n Před rokem +2

    How do you learn stuff like this? I know I learned it from you but how do you find resources to learn things like this.
    Some apps like Next have documentation that is extremely insightful but nowhere in the React docs would I have learned how react actually works.

  • @user-ux9ud7gf6q
    @user-ux9ud7gf6q Před rokem

    This is soo good. Thanks !

  • @mike110111
    @mike110111 Před rokem

    I'm confused - I've been following along with your T3 Stack Tutorial (I'm up to the part where we show user details in each tweet) and the page is definitely hydrating on load, the initial HTML is just a skeleton... Which seems to contradict what this video is saying?

  • @AsheAve
    @AsheAve Před 8 měsíci

    Nice explanation. Thank you.

  • @dixztube
    @dixztube Před rokem

    Great job man!!

  • @aaronmendez9284
    @aaronmendez9284 Před rokem +2

    The sun is energy.
    There is life on Earth.
    This video slaps.
    We all will pay taxes.
    These are nothing but straight facts.
    Great content Theo!

  • @yogiadianta1156
    @yogiadianta1156 Před rokem

    Hey theo, where can i found your vs code setting and extension list?

  • @davorinrusevljan6440
    @davorinrusevljan6440 Před rokem

    I am still trying to wrap my mind about what happens when page contains components that can not be rendered on server, how does all that gets stitched up. I guess at best there would be holes, or place holders for client side to fill in?

  • @prasad_yt
    @prasad_yt Před rokem

    Thanks for this helpful video.

  • @tastelikecrypto7051
    @tastelikecrypto7051 Před rokem

    The way I understood it is next js is aiming to do what Angular does. Thanks for the content.

  • @sidwebworks9871
    @sidwebworks9871 Před rokem +11

    I think the video title should be "How SSR/SSG works?".
    Also I would argue that a Next app is a multi-page application because the client still requests a new page when you visit a new route, it's just that the next router and hydration patterns makes it "feel like a SPA". It's not really a SPA.
    Anyways good video.

    • @rico454
      @rico454 Před rokem +2

      It is an SPA.
      _app only mounts once and handles all page routing so _app is the single page.
      NextJs just handles it quite cleverly making everything seem less.
      But you are right, the title of the video was confusing since I was expecting a deep dive into how the framework was built.

    • @sidwebworks9871
      @sidwebworks9871 Před rokem +1

      @@rico454 What you said is true and yes I think the terms are usually juggled around.
      Although it looks like MDN defines a SPA as an application which loads a single document page and updates that document's body using javascript.
      You can look it up.
      AFAIK it's neither of those 2, it's a Hybrid react framework.

    • @sitter2207
      @sitter2207 Před rokem +1

      @@sidwebworks9871 Thats what i think of when I hear SPA as well. So I'm a bit confused still. If that's not how nextjs works, then its just a MPA, that becomes SPA after html is requested, why not just become a static page at this point ? Isn't being SPA the biggest selling point of... well single page applications ? Because it makes navigating through pages so much faster. But next loses that ability by requesting the server side rendered html at every route change.
      I feel so dumb for not understanding the point of nextjs but im also still a beginner

    • @rico454
      @rico454 Před rokem

      @@sidwebworks9871 Maybe I’m confused but doesn’t Next adhere to that criteria? _app is loaded once and everything else is loaded with javascript, whether it’s static or SSR?
      Well that’s how I assume it works, I might be wrong

  • @OhDevBeard
    @OhDevBeard Před rokem

    Hey Theo, video on upgrading T3 app to use the app directory update of nextjs next? Why? Just because!

  • @oscardasilva971
    @oscardasilva971 Před rokem

    Valuable content, thank you

  • @pablom8854
    @pablom8854 Před 8 měsíci +1

    22:13 basically React explained in one phrase 😂

  • @NuanceWebsites
    @NuanceWebsites Před 11 měsíci

    you deserve a Nobel Peace prize for this youtube channel

  • @georixyo7115
    @georixyo7115 Před rokem

    genius explanation, thanks!

  • @pedroalonsoms
    @pedroalonsoms Před rokem

    your videos are awesome❤

  • @harshilparmar9076
    @harshilparmar9076 Před rokem

    So if we don't use getServerSideprops it will still generate static html for us but for data fetching it just works like Client side React. Am I correct?

  • @luisllaboj
    @luisllaboj Před 9 měsíci

    I've been learnig NEXTjs for almost a week reading the Pages Router docs, and there's something that still doesn't make sense in my head.... When a page that was rendered on the server gets to the client as a Loading state or as an UI skeleton, does that mean that the server have a "correct" but empty HTML version of what the user gets after the client fetches and loads the data? Only then the user gets the 2nd correct but complete version of the same HTML page?
    Idk if that's clear enough, hopefully it is..

  • @jazsouf
    @jazsouf Před 8 měsíci

    Next also has some caching mechanisms that can be good or bad. You don't get that with a regular Vite React SPA.

  • @bryanngen5572
    @bryanngen5572 Před rokem

    i watched this video when it first came out and again last night. got much more out of it after getting my hands dirty with Next
    great video

  • @jjrise
    @jjrise Před rokem

    dang, solid video!

  • @techne_
    @techne_ Před rokem +2

    I REALLY need a perfect SEO. I have just dumped NuxtJs which was terrible and I am in love with NextJS. Even tho it will take me a couple of months to rewrite I already see it will be smoother overall.

  • @nan5715
    @nan5715 Před 2 měsíci

    Explain how next js is a spa? If I request a different server side page then it has to go to the server right? The entire app isn’t loaded on the client?

  • @persas1683
    @persas1683 Před rokem

    Hi everyone, am I missing a part, or is this video simply explaining that NextJS will take care of the server-side processing through getServerSideProps and return the rendered HTML as a result.
    After the HTML has been returned to the client, the next part is entirely in react.

  • @SamyarBorder
    @SamyarBorder Před rokem

    How nextJS optimizes application for SEO? so if it's steel spa why we can't have good seo with cra?

  • @MrJgracias
    @MrJgracias Před rokem

    Many newer developers are running in development. Local host and all that, personally I have made a call to local storage in dev mode, and the program works fine. Will that not work in production?

  • @GeekOverdose
    @GeekOverdose Před rokem

    I wanna see if its possible to have React SSR with something like Spring boot

  • @cameronratliff8441
    @cameronratliff8441 Před rokem

    we have nest js backend and are looking to move to next js on the front end (from CRA). Server components seem really cool and powerful, but I am trying to wrap my head around how they can be used with an API and without bypassing guards. Any tips?

    • @zhongtom2625
      @zhongtom2625 Před 10 měsíci

      Do you mean bringing client credentials, such as tokens, when the server component making requests?

  • @tuktuk9004
    @tuktuk9004 Před rokem

    great explanation

  • @i-am-the-slime
    @i-am-the-slime Před rokem

    Would've been nice if you had explained how Nextjs works like with bundle splitting etc.

  • @JLarky
    @JLarky Před rokem

    24:31 I disagree, otherwise how come next.js ships bundle that is like 2x the size of comparable React+vite SPA?

  • @msrini
    @msrini Před rokem +1

    Good video editing

  • @voidmind
    @voidmind Před rokem

    I will also use this video to answer questions

  • @MrBlazzerBoy
    @MrBlazzerBoy Před rokem

    The font is hard to read on an 8 inch tablet. Can you please switch to some sans serif font?

  • @excalidraw
    @excalidraw Před rokem +3

    3:40 Shift-Opt-drag your line to duplicate on the same position and drag it on the vertical/horizontal axis 📎📄

  • @venus-sz2sl
    @venus-sz2sl Před rokem

    Love the thumbnail 🤣😍

  • @Lambda1235
    @Lambda1235 Před rokem

    Can this be used to obscure the api of the admin page?
    If an attacker tries to load the admin page without auth he wouldn't even know what js he should load, which would know how to interact with the api. Am i correct?

    • @m0rt068
      @m0rt068 Před rokem

      I don't know what you mean but serious information or data should always come from a secured api. You shouldn't just hide sensitive information in your client side app but should also secure your backend.
      Always verify who the user is in your backend before you send that data to your frontend. Doesn't matter what you are using this shouldn't be problem.

  • @notfadeaway6617
    @notfadeaway6617 Před rokem

    Why some people still use firestore on SSR? What are the benefits?

  • @FlorianWendelborn
    @FlorianWendelborn Před rokem

    Do you need to opt-in to Twitter Card Validator somehow? I’m getting a `403` error on both Firefox and Chrome when I try to use it, no matter what URL I try (even from other, well-known websites)
    Actually, I have the same symptoms as seen in 14:00

    • @SatyamSingh-rq2tc
      @SatyamSingh-rq2tc Před rokem +1

      The Twitter card preview has been disabled for everyone since April 2022.

    • @FlorianWendelborn
      @FlorianWendelborn Před rokem

      @@SatyamSingh-rq2tc Amazing that they still have the website up then lol

  • @TheUltimateGeminiHasSurvived

    I shared this with my co op student! Can you make the same for Astro?

  • @johndoyle3816
    @johndoyle3816 Před rokem

    sick painting

  • @nroose
    @nroose Před rokem

    Next can't do all of the things that can be in "this is next". The server could serve the original page with some parts that are based on cookies, etc.

  • @mrxcreamy10
    @mrxcreamy10 Před 11 měsíci

    What does React Native do with expo?

  • @Aristocrator
    @Aristocrator Před měsícem

    Why not to put an actual html into the react root page instread?

  • @luissolanodev
    @luissolanodev Před rokem

    Is there a reason to ever use something like vite given your statement about regreting not be using nextjs when SEO becomes relevant?

    • @magne6049
      @magne6049 Před rokem

      you can SSR with Vite too

    • @luissolanodev
      @luissolanodev Před rokem

      @@magne6049 thanks! I guess my question is more about where do tools like vite fit? Does it come down to the other specific feature they have other than SSR to determine whether I want to use (i.e.) vite vs nextjs? Sorry I may be just lacking knowledge about vite

  • @nan5715
    @nan5715 Před 2 měsíci

    What does it mean by correct html?

  • @MrStanley85
    @MrStanley85 Před rokem

    I had a hard laugh on "servers dont have windows because they run linux" :D excited about t3 stack

  • @niksatan
    @niksatan Před rokem +3

    Dude, you are the best in making this voodoo technologies accessible to n00bs, thx!

  • @coder1122
    @coder1122 Před rokem +1

    Just awesome

  • @KevinOfSteel
    @KevinOfSteel Před 8 měsíci

    Great explanation! Just not gonna ask any questions to avoid being outright stupid.

  • @hemanthkotagiri8865
    @hemanthkotagiri8865 Před rokem

    is this still valid after Next.js 13 Release?

  • @AndrewTSq
    @AndrewTSq Před rokem +2

    Is PHP considered server side rendering?

    • @mqix3741
      @mqix3741 Před rokem +2

      Yes its its whole purpose

    • @magne6049
      @magne6049 Před rokem

      PHP and the likes do "classic server-rendered templates", but SSR is generally used to refer to rendering an SPA on the server. Using SSR for the former can be confusing, albeit semantically correct.

  • @stvlley
    @stvlley Před rokem +1

    when I see your videos I feel I am being assigned homework... "if you wanna get good at this you better watch his video"

  • @guillermoquiros2402
    @guillermoquiros2402 Před rokem

    Just Great!

  • @vishalsangole836
    @vishalsangole836 Před 6 měsíci

    so react is still shipped to client huh

  • @deamorta6117
    @deamorta6117 Před rokem

    Your voice sound really arrogant but you really are a good teacher which negate the latter hahaha thank you so much

  • @samuelgunter
    @samuelgunter Před rokem +13

    amazing video

    • @samuelgunter
      @samuelgunter Před rokem +7

      probably, I haven't finished watching it yet

    • @samuelgunter
      @samuelgunter Před rokem +2

      my hypothesis was correct
      (I watch at 2x speed)

  • @lilililliilil
    @lilililliilil Před rokem

    GREAT GREAT GREAT VIDEO

  • @lightninginmyhands4878

    React = interactive sites
    Next = HTML correct for sites as soon as they load

  • @henrmota
    @henrmota Před 6 měsíci +1

    You should do the same for the new version....

  • @nroose
    @nroose Před rokem

    I guess I would say "incomplete" rather than "incorrect" for the initial html.

  • @apratimjaiswal
    @apratimjaiswal Před rokem

    Amazing