Server-side rendering library for React Router v4 (version 4.2.3). Provides utilities for SSR including state fetching, code splitting via Webpack 2, and preloading modules. Requires peer dependencies react (^15.3 || ^16), react-dom, and react-router (^4.0). Ships TypeScript types. The project is in maintenance mode and seeking maintainers. Key differentiators: integrates tightly with React Router v4, offers a custom renderToString that returns a promise, and includes a Module component for code splitting.
npm install react-router-serverNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Server-side render a React Router v4 app with async state fetching.
Migrate to React Router v6 and use its data loading APIs.
Always await or .then() on renderToString result.
Use: <Module module={() => import('./SomeComponent')}>...</Module>On the server, only call fetchState once; on the client, call it in componentDidMount.
npm install react-router-server, then import named exports.
Use import { renderToString } from 'react-router-server';Change to: <Module module={() => import('./MyComponent')}>...</Module>