26 ms·
Basically if you do a static export from next.js and ignore routing, you get a react SPA. You can do the same in Gatsby, but it's probably a waste of time. Bu
by jameshart 4y ago
Basically if you do a static export from next.js and ignore routing, you get a react SPA.
You can do the same in Gatsby, but it's probably a waste of time.
But...
With an index.html file containing a createRoot(document.getElementById('root')).render(<MyApp/>) call, and parcel or vite or webpack, you can produce much the same thing.
Possible that next.js will give you easier access to some more interesting ways to split your JS bundle up - but also possible it will fight you if you continue to insist on not taking advantage of SSR.
- leerob 4y agoIf you roll your own with a bundler, you will also need to integrate a router. Next.js is providing a routing layer for you. If you want to stick with a static/SPA the entire time, that's fine. You don't have to use SSR unless you need it. https://nextjs.org/docs/advanced-features/static-html-export https://nextjs.org/docs/advanced-features/static-html-export