Is nextjs recommended with convex? or not ideal?
I’m trying to decide what react framework I should use when building on convex.
I’m fairly new to the react world but I’ve built apps with many types of tech stacks over the years.
I know convex works with any react framework. Though it seems like it overlaps with some nextjs functionality and maybe I would be better off using vite + tanstack pieces, etc. I’m building a single page app and don’t need SSR but it seems like nextjs is still popular for most use cases. This is a real b2b SaaS app I’m building so I want a solid framework foundation for a bigger/complex product.
Anyone have any suggestions on this topic? It seems like nextjs isn’t an ideal fit with convex even though it works just fine.
15 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Next.js works fine for right now... especially if you value 100% stability. if you're feeling a little more daring, tanstack start is pretty great. I hope this answer will be different in 3-4 weeks once start really launches and we're done with our integration. at that point I do think convex + tanstack start wil be the best experience with react + convex together
Thanks that’s really helpful.
I’m just realizing that convex doesn’t include web hosting, so I guess that makes a bit more sense why nextjs + vercel + convex could be a good fit too.
I'm really enjoying using Remix with Convex, especially when it comes to the built-in outlet context. This makes it easy to query Convex in a parent route and pass the result to any number of child routes instead of using query hooks in child route components.
I’m curious why Remix wouldn’t be a great fit as well? Since Convex could handle all of the backend business logic, then nextjs is possibly overkill, and something like remix could be a great fit. Or Tanstack start when that’s more officially released like you said.
But I’m curious what you think of the case for remix?
Any other opinions are welcome
So, we've spent a lot of time with tanner and the tanstack team, and tanstack is very aligned with how we think the relationship between clients and servers should work. in particular, we have goals for "automatic SSR" that ideally don't require things like loaders, and "session resumption" that seamlessly hands of your SPA subscriptions starting from exactly the server-side snapshot timestamp
tanstack start / router / query has all the hooks we need to achieve what we think is the right balance between SSR + SPA, because of this philisophical alignment
remix may as well, the truth is: we just haven't spent as much time with it.
in general, if something is asking you to specialize your code a lot for server-side rendering, we think that's not ideal and we'd like to avoid that if at all possible. so that's likely the dividing line
Tom on our team knows a lot more about all this than I do, but he's been focusing on tanstack start right now just to get that 100% over the line so we have one full stack setup that we're really, really happy with. Next.js has never quite been it
we can look more at remix and all the good work you all have done when we get tanstack taken care of
aka
"use client"
== 🤮That’s very helpful thank you!
I need to finalize the technology choices for a new project my team will be starting on next week. If I wanted to focus on Tanstack and the “ideal setup” for convex, should I just start building on it now hoping Tanstack Start gets finalized quickly enough to keep up with us?
It’s either that or we fall back on nextjs and configure it to work the best way it can with convex. I think it can be used more as a SPA, and still use tanstack router/query
or the whole React router v7 + Remix merge that sounds interesting but I don’t know anything about its design yet.
Hello Jamie, will i need to know react to use tanstack? I use Sveltekit and im pretty happy, but I want to be integrated into Convex in the best way possible
Whats your suggestion? thanks!
Like I said above, my experience so far using Convex with Remix is nothing but amazing. Granted I'm just learning Remix so I don't necessarily know if I'll hit any snags down the road, but everything so far has been extremely smooth. I've used NextJS in the past, and definitely prefer Remix.
Are you using the new React Router V7 / Remix?
Any material you suggest reviewing to get up to speed on using remix + convex?
Not using React Router V7. Just the current version of Remix.
As for getting up to speed, I just followed the walkthrough in the Convex docs
Does this mean we are seeing a convex-auth adapter for tanstack-start one where we get call getAuth() or a imilar function in createServerFn (Server functions) like is available with clerk ?
yeah, we're aiming to get auth working really well with tanstack start as well
Please !! Sveltekit is my stack of choice but realised it might be a forever wait to get the kind of support needed for it from convex, so switching to tanstack-start (closest thing to solid-start and sveltekit on the react side) and legend-state . Auth is just what is pending and i am not so keen on clerk ATM
agree svelte 5 and solid are both amazing. I wish more people were using them! on the react side, I think tanstack is the best designed one.