by CSDude · 1y ago · 0 comments
No you do not need NextJS or any other server side JS for most of the projects. Let's not pretend SPA is dead. Most of you do not need server side rendering and all the complexity it brings.
Just use Vite. You can decide whether to add Tailwind etc later. React should be left bare bones, and it can recommend frameworks, not make them sound default.
npm create vite@latest my-app -- --template react-tsThere are good parts like server actions, however they are plagued with very strange limitations making them not so useful.
If you want to statically generate websites and want to use React, NextJS can be a good choice, however for complex web applications I find that it's not ambitious enough to justify even the extra compile time that I get from its tooling compared to Vite.
Why would you optimise for SEO on a webapp? What's the use-case there?
If you're not writing a webapp, then any server side rendering would do and client side components aren't needed anyway.
But that is quite a mouthful, so people shorten it to Vite. So, when they say switch to Vite, Vite-react plug-in is implied. No one is recommending rolling your own Vite plug-in for react
What else does that plugin do? HMR? Equivalence to CRA is next, which is a set of opinionated loaders and config. But next also has the router and some react utils on top.
The goal however is to create a minimal setup to get started with React SPA. And vite's starter template does better