> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/node.js/overview-1/react-router.md).

# React Router

React Router in **framework mode** (the successor to Remix) — file-based routing, loaders/actions, and SSR. Hostinger runs it in server mode with the Express adapter.

**`app_type`:** `react-router`

> Using React Router as a client-side routing **library** inside a React/Vite app? That's just a [React](/node.js/overview-1/react.md) deployment — this page is for framework mode.

## Server mode

Hostinger detects a React Router app from `react-router` + **`@react-router/express`** in dependencies.

### `package.json`

```json
{
  "scripts": {
    "build": "react-router build",
    "dev": "react-router dev",
    "start": "node server.js"
  },
  "dependencies": {
    "react-router": "^7.1.0",
    "@react-router/express": "^7.1.0",
    "@react-router/node": "^7.1.0",
    "express": "^4.21.0"
  }
}
```

### Minimal `server.js`

```js
import { createRequestHandler } from '@react-router/express';
import express from 'express';

const app = express();

app.use(express.static('build/client'));

app.all(
  '*',
  createRequestHandler({
    build: await import('./build/server/index.js'),
  })
);

app.listen(process.env.PORT ?? 3000);
```

### hPanel settings

| Field            | Value          |
| ---------------- | -------------- |
| Application type | `react-router` |
| Build script     | `build`        |
| Output directory | `build`        |
| Entry file       | `server.js`    |

An entry file is **required**.

## Static mode

For a fully static site, disable SSR (`ssr: false` in `react-router.config.ts`) and deploy `build/client` as the output directory — or use plain [React + Vite](/node.js/overview-1/react.md).

## Notes

* Listen on `process.env.PORT` — don't hard-code a port.
* Loaders and actions run on the server; put secrets in [environment variables](/node.js/environment-variables.md), not client code.

***

*Last updated: July 22, 2026*
