Next.js Discord

Discord Forum

Is this an acceptable way of doing things?

Unanswered
Pollock posted this in #help-forum
Open in Discord
PollockOP
This is the general practice I'm following to do things as server components proved to be a poor fit. I just wanted to make sure I'm following good practices. Many thanks 🙂

1 Reply

- when you have multiple set state in series, you might want to involve a reducer
- read that: https://react.dev/learn/you-might-not-need-an-effect#fetching-data
Dan Abramov thinks that using a library for data fetching is more relevant as its extremely annoying to implement, but also provides tips if you want to keep a good old fetch call. see SWR in the Vercel ecosystem: https://swr.vercel.app/fr-FR
- there is nothing wrong or right between RSC or a traditional SPA architecture with client-side data fetching call. It's about your context, the metrics you want to optimize, the skillset of your team, the libs you use, how dynamic is your content.....
- your component is not interactive it seems, the fetch call doesn't take any parameter => why RSC were not a good fit here? A good reason would be if the remainder of your app is not a good fit (for instance it's a SaaS software, with very dynamic fetch calls). But for content app they are an interesting choice