React Router can be deployed two ways:
To get the most benefits from React and React Router, we recommend fullstack hosting.
You can get the most out of React and React Router by deploying to a fullstack hosting provider.
Click this button to automatically deploy a starter project with your GitHub account:
This template includes:
<Image/>
component with Cloudflare ImagesStart with the Epic Stack template and follow the instructions in the README:
npx degit @epicweb-dev/template my-app
This maximalist template includes a lot, including, but not limited to:
Start with the ion template and follow the instructions in the README:
npx degit @sst/react-template my-app
This template includes:
<Image/>
component with S3Click this button to automatically deploy a starter project with your GitHub account:
This template includes:
<Image/>
and Netlify Image CDNClick this button to automatically deploy a starter project with your GitHub account:
This template includes:
<Image/>
and Vercel imagesIf you want to deploy to your own server or a different hosting provider, see the Manual Deployment guide.
React Router doesn't require a server and can run on any static hosting provider.
You can get started with the following Deploy Now buttons:
Ensure the ssr
flag is false
in your Vite config:
import react from "@react-router/dev/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [react({ ssr: false })],
});
Build the app:
npx vite build
And then deploy the build/client
folder to any static host.
You'll need to ensure that all requests are routed to index.html
. This is different with every host/server, so you'll need to find out how with your host/server.