React Hosting
Host your React app without a deploy pipeline
Build with Vite (or any React toolchain), drag the output folder into StaticHero, and your app is live with HTTPS, SPA routing and instant rollbacks.
- Build command
- npm run build
- Upload folder
- dist/
- SPA routing
- Supported
- Free plan
- Yes
In short
To host a React app on StaticHero, run npm run build, then upload the generated dist folder (Vite) or build folder (Create React App). Enable SPA mode so React Router routes work on refresh. Your app is served over HTTPS on a free statichero.site subdomain or your own domain, with optional forms and analytics.
Updated
How to deploy React to StaticHero
- 01
Build your project
Run
npm run buildin your project folder. - 02
Find the
dist/folderThat folder contains plain HTML, CSS and JavaScript — the only thing your visitors need.
- 03
Drag it onto StaticHero
Drop the folder (or a ZIP of it) into your site in the dashboard.
- 04
Turn on SPA mode
In site settings, enable single-page app mode so client-side routes work on refresh.
No build servers
You build where you already build; we publish in seconds. No queue, no build minutes.
Instant rollback
Every upload is a version. Restore any previous build with one click.
Forms & analytics
Add a contact form and visitor analytics without a backend or extra scripts.
Custom domain + HTTPS
Connect your domain with one DNS record; certificates are automatic.
Configuration
Vite’s defaults work as-is. If your app lives at the root of the domain, keep base at /:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
base: "/", // site root on StaticHero
build: { outDir: "dist" },
});React Router and deep links
Client-side routers handle URLs like /settings/profile in the browser. When someone refreshes that page, the server has no such file — which is why many hosts return a 404. Turn on SPA mode in your site’s settings and StaticHero serves index.html for any route without a file extension, letting React Router take over.
Prefer config in code? Add a _redirects file with /* /index.html 200 to your public/ folder and it will be copied into dist/ on every build.
Environment variables
Variables prefixed with VITE_ are baked into your JavaScript at build time and are visible to anyone. Never put secret API keys in a React app — use services with publishable keys, or call your own API.
React apps from AI tools
Got a single React component from Claude, v0 or ChatGPT rather than a full project? Use Paste code — StaticHero wraps the component with React, Tailwind and common libraries and publishes it as a working page. See Claude artifacts hosting.
Does StaticHero support Next.js-style server rendering for React?
+
No — StaticHero serves static files. Client-rendered React apps (Vite, CRA) and statically exported frameworks work perfectly. For Next.js, use static export; see our Next.js hosting guide.
Do I need to change the homepage field in package.json?
+
Only for Create React App when the app isn’t at the domain root. On StaticHero, apps live at the root, so the default works.
Can I host multiple React apps?
+
Yes, each as its own site. Free includes 1 site; paid plans include 5, 15 or 50.
How big can my bundle be?
+
Up to your plan’s per-site storage (10 MB free, up to 2 GB on Business). Most React apps are well under 5 MB.
Your site could be live in the next minute.
One site free, forever. No credit card, no setup, no servers.