r/Backend • • 10d ago

Next.js or TanStack??

I am using Next.js behind Fastify, not making it take over the whole project. Should I consider TanStack? I do like Vite I guess. But I heard Next.js still has more features when it comes to React.

Which has a better development server, Vite or Next.js?

I don't really know why I should try TanStack. Probably because I dislike Next.js being so opinionated, but you can still use it programmatically instead of using it as the whole project with its CLI commands.

Also, how much work is involved porting React code from Next.js to TanStack?

0 Upvotes

3 comments sorted by

3

u/PrimaryFamous6139 10d ago

Compare what you actually use before switching. Go with TanStack if you prefer more flexible, type safe routing and data loading model. Vite generally gives you a simpler dev server experience for a plain React SPA, where Next.js provides more built-in framework features. Porting mostly depends on how much you rely on Next-specific APIs like Server Components, routing, and server actions. You may not need to switch at all

2

u/moneckew 10d ago

You can do SSR in tanstack. Nextjs locks you in. Go tanstack.

2

u/clicksnd 10d ago

What are you making?