Next.js Is Confusing - Is This Server or Client Code?

Поділитися
Вставка
  • Опубліковано 3 лют 2025

КОМЕНТАРІ • 24

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

    Nice introduction! the 'server-only' library is also used in Nextjs itself.

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

      I feel like there should be a better solution, but it's better than nothing

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

    Sir, the quality of your videos are awesome and the explanations are simple
    Thanks for the quality content😊

  • @7doors847
    @7doors847 Рік тому

    This is a great example of the “best and worst things” about Next.js
    Btw, hope you still keep that Telecaster around Sam 😉
    Cheers and thanks for the awesome content!

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

    Had this same issue some days back, I was so upset that I deleted the entire code and started over 😢
    Thanks man

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

      Thats not the first time i've heard of someone doing that this week

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

    so basically, dependency injection is the only way for all client components.

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

    bro your moustache is fire 🔥

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

    I thought you don’t need to add “use server” as that’s the default ?! 4:25

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

      you need to add it to server actions.
      Also, remember that if you import anything into a client component, it becomes client by default.

  • @oghenekarouzezi4504
    @oghenekarouzezi4504 4 місяці тому

    Do you have a course on udemy for next.js?

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

    What's your thoughts on Remixjs?

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

      It's great! I also like using React on it's own for SPAs.
      They're all great and all come with their own upsides and downsides and confusions. You just gotta make sure you're really competent with at least one so you can actually build a full app when you need to.

  • @ray-lee
    @ray-lee Рік тому

    5:38 this has been fixed already in 14.0.3

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

      I installed the latest versions of everything before shooting the video and there’s definitely still issues when you don’t host with vercel. Might be a system issue or something else.

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

    Bruh, just move to Qwik, you just write normal react and everything will render on the server with no worries about what will render on the server and what will render on client. Qwik is more developer friendly, way faster… its just Qwik!

  • @valeriikuzivanov6832
    @valeriikuzivanov6832 5 місяців тому

    just don't use next as backend, only as SSR

  • @LilyWang-h1j
    @LilyWang-h1j 8 місяців тому +2

    it's seriously very confusing... i cannot use useState on both server and client components.. i cannot even distinguish which one is which.. react is so garbage

    • @Sooraj-Rao6
      @Sooraj-Rao6 8 місяців тому +1

      Not react, but next js

  • @davedude101
    @davedude101 5 місяців тому

    omg thx

  • @EskoLuontola
    @EskoLuontola 5 місяців тому

    ...or you could use htmx 😏