Void, vinext, or React Router for a Cloudflare app?

By

Updated

Tagged: Cloudflare

Choose a Cloudflare full-stack setup by following a request, a database change, and a deployment through Void, vinext, and React Router.

You want to build a full-stack app on Cloudflare, and Void, vinext, and React Router all come up. They make different assumptions about the app you already have.

With an existing Next.js app, I’d try vinext before rewriting its routes. React Router fits a new React app organized around server loaders and form actions. Void is the one I’d look at when a Vite app needs a backend and resources provisioned with it. They also overlap, since Void can manage resources and deployment around a React Router app while React Router keeps routing and rendering.

All three deploy to Workers rather than Pages, which is what Cloudflare recommends for new projects. I compared the two in Cloudflare Pages vs Workers.

Let’s compare them through a reading-list app, where a signed-in user saves a URL, sees their articles, and marks one as read. This comparison follows each project’s documentation, not benchmarks.

Begin with the code you want to keep

Rewriting a working router means revisiting forms, errors, authentication, and deployment, so an existing app’s framework is part of the cost.

Before choosing a replacement, list the conventions your app relies on. Next.js code may use Server Components or Server Actions, a React Router app may already be organized around loaders and nested layouts, and a plain Vite frontend may have none of those.

For a new project, decide where the first request runs. Does the server need to authenticate the user and fetch articles before rendering HTML, or is a static frontend calling a JSON API enough?

Fig 1 · 1/4Follow a reading-list feature
Choose the request and rendering model

Native Void: one Vite app with a backend

Void’s app types documentation describes a native application with API routes and optional server-rendered pages. It can also wrap a frontend that talks to those routes.

For the reading list, a native Void request can follow this path:

Browser submits a URL
  → Worker middleware identifies the user
  → Void server handler validates the URL
  → Database write records the article's owner
  → Response updates the reading list

My Void tutorial builds this reading list step by step, with Hono-based handlers and the database setup. It starts from an empty folder:

mkdir reading-list
cd reading-list
npm install -D void
npx void init

and ends by deploying to your own Cloudflare account:

npx void deploy --platform cloudflare

Void’s deployment workflow infers resources from your code and provisions them. Its quickstart covers deploying directly to a Cloudflare account or to a team hosting platform.

That workflow is the reason I’d evaluate it, since a database-backed feature’s resource declaration and schema change ship with the deployment. It also means reviewing what each deployment will change: which account gets the new infrastructure, where production data lives, and how a migration affects the previous version of the app.

React Router: routes own loading and mutation

React Router’s framework mode gives routes server loaders for data. A route can load the signed-in user’s saved articles before rendering its component. A form action can validate and save a new article, then return validation feedback or redirect.

For our reading list, you trace the request at the route: one loader reads the articles and one action creates them, while shared layout routes supply the surrounding UI.

Cloudflare’s React Router guide sets up a Workers project with the Cloudflare Vite plugin and bindings available to server code. Start from its scaffold instead of assembling configuration from an old tutorial:

npm create cloudflare@latest -- my-react-router-app --framework=react-router

The project it creates deploys with npm run deploy.

The guide says SPA mode and prerendering aren’t supported with the Cloudflare Vite plugin. For a single-page app it recommends starting from the React template and using React Router as a library, which is a different setup from this server-rendered one.

For a new React app, I’d choose this path when I want data loading and forms organized around routes throughout the app.

vinext: investigate an existing Next.js app

Cloudflare’s Next.js guide recommends vinext for running Next.js applications on Workers. vinext is a Vite-based reimplementation of the Next.js API surface.

For an existing reading-list app, the question is whether its routes and rendering conventions keep working. The guide starts with a compatibility check, run from the app’s folder:

npx vinext check

If the check passes, npx vinext init sets vinext up in the project, and npx @vinext/cloudflare deploy deploys it to Workers. A new Next.js app on Workers starts with npm create cloudflare@latest -- my-next-app --framework=next.

The same API surface doesn’t mean every package or behavior works. vinext’s compatibility documentation lists the supported features, and libraries that assume a particular Node runtime or deployment platform need their own check.

I’d keep the first trial small. Run the existing list page, submit the save form, test the authentication boundary, and confirm the database write lands in the expected account and environment.

For a brand-new app, I’d only choose vinext when I specifically want the Next.js programming model on Workers.

Follow the same feature through each option

DecisionNative VoidReact Router on Workersvinext on Workers
Incoming requestVoid routing and Hono-based middlewareFramework route and its server loader or actionThe supported Next.js-style route or server entry
Database accessVoid resource APIs can coordinate schema and bindingsServer code uses the configured database binding or clientServer code uses supported runtime APIs and configured bindings
Save formHandler or pages action in the native appRoute action with route-level data flowSupported Server Action or route handler
Deployment workVoid’s resource and deployment workflowWorkers project and its generated build configurationvinext build and its Workers deployment integration
Strong starting reasonYou want a Vite backend with managed resourcesYou want React route loaders and actionsYou want to retain or adopt the Next.js API model

The database is still a separate decision. A framework can make D1 convenient, but your queries and data model decide whether it fits, not the starter template.

Void can wrap another framework

Void’s app types guide explains that a framework integration keeps its own routing and server rendering, and Void adds resource inference and its deployment workflow around it. So you can use React Router’s application model and decide separately whether you want Void’s infrastructure workflow.

Check the framework integration guide before assuming native Void features carry across. Void-managed authentication, for example, isn’t supported in framework mode, so you’d use the framework’s own auth integration.

Give each concern one owner. If two tools both generate a deployment file or provision a database, know which one wins.

Test an authenticated write before committing

For the reading list, I’d check these cases with test accounts:

Then build for production and test it in the Workers runtime, since a development server can hide a dependency on local Node behavior, filesystem access, or credentials that won’t exist in the Worker.

Finally, take one schema change through a preview and a deployment. Check that the preview uses separate data, read its migrations, and make sure deploying it doesn’t touch production resources.

Want me to talk about your product? You can sponsor this site.

Related posts about cloudflare: