DO NOT Use Hooks in Next.js?? | Josh Reacts

preview_player
Показать описание
Interesting take, here's my thoughts

-- my links
Рекомендации по теме
Комментарии
Автор

my sincere condolences for the small editing mistake lol

joshtriedcoding
Автор

Both client and server components are important as they both have a role to play.

sukritsaha
Автор

I tend to say make every page a server component and then you can use client components inside of that page. That way you can do all the fetching directly from the server and then pass it down to the client components without creating APIs. If you can use server component then you should but client components are still needed.

marufbepary
Автор

Without client components, we start at ground zero. How can we implement `onClick` or` onChange` functionality in server components? 🤣🤣🤣🤣

bibartaks
Автор

Thanks for the video josh, can you maybe make a video on how you would handle nice looking loading states (skeletons) for single components? Thanks a lot!

coffeeaddict
Автор

Come on, bro! I'm in the middle of a 14-hour React course and loving it. Now, what's next for me? I'm really into Next.js, so it would be fantastic if you could create a coding video explaining it. There are many beginners like me eager to learn from you. Thanks a lot!

Salah-YT
Автор

Idk man, using nextjs for a website that is mostly server rendered and has bunch of interactivity sprinkled in sounds ridiculous to me since there are much better alternatives for that. But that's what nextjs developers are pushing for. I just want my highly interactive web app to be able to show itself quickly on the browser and also have good SEO. That's all I want from nextjs.

enversecilmis
Автор

josh finally swallowing the CSR pill? didn't think i'd live to see the day.

FunctionGermany
Автор

But what if i liked working on the client

sjoerdvermeijden
Автор

If I have to give up on the client side stuffs, why wouldn't I use another language like PHP, which is far more mature and works with minimal amount of code as well (minus the type safety by default, but it can be made better)? Why can't it be both at the same time? This is what made me to switch from the react eco system to other similar ones like Qwik and Nuxt.

BlurryBit
Автор

I don't get it. Isn't the best of all worlds that we get fine-grained control to use server and client as it best fits the use case?

Also, re client components vs server: sure, the client has to download a bunch of javascript files but the entire process isn't just downloading but processing and rendering data. Let's say you have charts you need to display based on data; isn't it very inefficient to have the server process and render for every client those graphs when it can just ship the raw data and "instructions to make the graph" (javascript files) to the client so that computing power gets off-loaded to the client's device and the server only has to worry about sending the plain data?

filipniklas
Автор

Hey Josh, awesome video as always, about the topic, as I am also working mainly with NextJS (still preferring the versions prior 13) I have started doing few hobby projects on the latest version, and what I am experiencing is hard times. In my honest opinion Vercel's team have to think about making something in-between(client and server), like state management can't be avoided everywhere and so I guess version 13 contributed not that much as caused frustration and negative impact, however think that within short period of time we will have best of both worlds of React and PHP. Anyways, keep up the good work!

georgepetroff
Автор

Purely client side is not fun, Purely server side is also not fun, A good mixture of both and knowing when to use which is where it gets very good

festusyuma
Автор

can u make a project using T3 stack plz, it been a while that u have uploaded a detailed project video .

rudrapratapsingh
Автор

If the devs would actually care about the performance they wouldn't use react in the first place

kwcu
Автор

ok... internet is getting faster... devices are getting faster... transfer is getting cheaper... i don't feel that shipping js code to client should be a problem. I feel only that Vercel want to maximise income. Client side code is against their business model.

Next with SSR is extremely unpredictable if you host that on ASW [not VERCEL with EDGE]. With 6000 RPM we need host that on >25 machines cause where CPU usage is >50% than TTFB goes to >1s. There are leaks between node versions (for example node 18.12.0 doesn't leaks, but node 18.17 leaks). If there is so many problems with SSR than I'm pretty sure that with RSC it would be even more. I don't get why next has so much hype.

michakrecisz
Автор

exactly what you said around the 1:10 mark: they KINDA have a point...?

like, i can see where they're coming from, but it also feels like being controversial for controversy's sake. the lift of doing everything on the server and ignoring client-side react as much as possible (pretty big paradigm shift), vs the amount of devices or use cases that would even see a massive benefit from this architectural change...

i dinnae... the overlap feels so small as to not really be worth it. it's literally going to be that one dude with the iphone 3G that somehow still works. they're going to be absolutely thrilled, i guess.

bridgetown
Автор

Hey Josh, can you make a full tutorial on react query...

sivajikondeti
Автор

IMO, you should use client components when you need interactivity and as much as possible use it for the leaves if it make sense to your app. there is just one pain with RSC is that you do not have context api at your disposal(there is a proposal for that called createServerContext) and react 18 says deduplicating requests done go ahead and use fetch close to the place your data live as much as you want but you eventually you find your code base too dirty with fetching same data multiple places. I tried HOC and component composition to solve it. at the end of the day react is unopinionated and you should follow best practices.

amixengineer
Автор

Hej Josh 👋 I am just dreaming here but that would be awesome a recorded hour talk (podcast?) with the author of the reddit post, where both of you would confront your ideas and discuss that topic and claims <3. Danke schön for the video!

hnmss