⚛️ React SSR vs server components

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

КОМЕНТАРІ • 27

  • @syedhaider0916
    @syedhaider0916 Рік тому +15

    Wow nice knowledge in such short video. Have been checking this channel out lately and I mean it when I say that given he does it consistently he has all the potential to go to 1 million. Keep up with the nice content bro.

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

      Ah this made my day. Thank you 🙏

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

    Second short I've watched so far after the "react server components explained"... subbed cuz you're so good.

  • @mouhamedbourouba3637
    @mouhamedbourouba3637 6 місяців тому +2

    "idiot admire's complexity, genius admire's simplicity".

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

    Nice guide. I had to watch a few times to understand the second explanation, it I’ve got it now. You’d use server to write components (via the “use server” directive) that can access the DB, and then use the “use client” directive to enable client side interactivity, offering the best of both worlds, only in a confusing manner, lol.

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

      Personally, while I realize this is great for full stack developers, I don’t think it’s good for the industry. FE and BE are so deep that true mastery over both domains is next to impossible. It’s better to have specialist that strongly understands their world, and a little of the other world rather than just a little about both worlds.

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

      I totally understand where you're coming from@@Sindoku. In this case, I think React will bring a lot of frontend devs into the deep end of backend. I do worry that NextJS backends are very DIY (including the auth and security sides), which can lead to poor practices.
      I really believe in Astro.build's model, where server templating is *just* server templating (without the streaming or blurring of boundaries). Expect more content on that!

  • @Akshatgiri
    @Akshatgiri 11 місяців тому +1

    It’s worth mentioning that server components don’t necessarily render out to HTML. By default they send back json which hydrates the frontend

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

    I'm wondering if server components are being adopted already in enterprise applications?
    I generally see only react like usual client side approach that too without ts lol sometimes.

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

    I have a question tho... Once a component has been marked with the "use client" directive, does that automatically turns its children to client components 🤔

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

      Yes it will! Let's you use React libraries that don't have "use client" yet

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

      Every import to this client component will be client components

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

    modern web development is crazily confusing somehow 😅 at least for me personally

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

      I've explained 10+ frameworks on YT shorts and I haven't even hit them all. Don't worry, everyone's a little confused 😅

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

    Do I need to learn nodeJs and expressJs for learning these topics?

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

      Not really, but you should to get a better understanding of the whole thing

  • @tmanley1985
    @tmanley1985 7 місяців тому +1

    I'm going back to html and css.

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

      How the pioneers did it 🫡

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

    I still confused

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

    Why did next made decision to make all components server component and in order to use client component you need to add use client.
    It should have been other way around like use server for server component and everything else works client component.

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

      Well, they wanted the default to be the top-level piece. You can't import server components into client components (technical reasons for this!), so you'll likely use server components for layouts and pages. I also agree that less client JS is a good default. Given those 2 things, they probably made the right call. It's a learning curve for sre though

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

      I'm sure the authors of NextJs have a pretty good idea of what they are doing...

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

    Everyone is confused

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

    I think it should be opposite. Server components should be both, and server should be server only. Just change the names. But that’s not gonna happen.

  • @Nonsense116
    @Nonsense116 8 місяців тому +1

    React was a mistake

    • @deadchannel8431
      @deadchannel8431 8 місяців тому

      Server components r a good thing broo

  • @abishektamilan9733
    @abishektamilan9733 Місяць тому

    CSR >>> SSR