{"id":27334,"library":"react-router-es3","title":"React Router (ES3)","description":"A complete routing library for React that keeps your UI in sync with the URL. Version 2.6.1-rc0 (JS-only release, no TypeScript types). Provides simple API with features like lazy code loading, dynamic route matching, and location transition handling. This package is an ES3-compatible fork of react-router v2, targeting older environments (e.g., IE8). Always use the official react-router package for modern development.","status":"active","version":"2.6.1-rc0","language":"javascript","source_language":"en","source_url":"https://github.com/compulim/react-router","tags":["javascript","react","react-component","routing","route","routes","router"],"install":[{"cmd":"npm install react-router-es3","lang":"bash","label":"npm"},{"cmd":"yarn add react-router-es3","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-router-es3","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for React components.","package":"react","optional":false}],"imports":[{"note":"Named export, not default. CommonJS: const Router = require('react-router-es3').Router","wrong":"import Router from 'react-router-es3'","symbol":"Router","correct":"import { Router } from 'react-router-es3'"},{"note":"Named export from package root. Do not use subpath imports.","wrong":"const Route = require('react-router-es3/Route')","symbol":"Route","correct":"import { Route } from 'react-router-es3'"},{"note":"Use 'react-router-es3' instead of 'react-router' for this fork.","wrong":"import { browserHistory } from 'react-router'","symbol":"browserHistory","correct":"import { browserHistory } from 'react-router-es3'"}],"quickstart":{"code":"import React from 'react';\nimport { render } from 'react-dom';\nimport { Router, Route, Link, browserHistory } from 'react-router-es3';\n\nconst Home = () => <h1>Home</h1>;\nconst About = () => <h1>About</h1>;\n\nrender(\n  <Router history={browserHistory}>\n    <Route path=\"/\" component={Home} />\n    <Route path=\"/about\" component={About} />\n  </Router>,\n  document.getElementById('root')\n);","lang":"javascript","description":"Basic setup with two routes using browserHistory."},"warnings":[{"fix":"Use the official react-router package for modern development (v3+).","message":"This is an ES3-compatible fork of react-router v2. It is not the official react-router package.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Install @types/react-router for v2 types, but they may not match perfectly.","message":"No TypeScript type definitions. Importing from 'react-router-es3' will cause TS errors.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use a stable version if available.","message":"Version 2.6.1-rc0 is a release candidate; API may change before stable.","severity":"breaking","affected_versions":"2.6.1-rc0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install react-router-es3' and ensure import path is correct.","cause":"Package not installed or module name misspelled.","error":"Cannot find module 'react-router-es3'"},{"fix":"Add 'import React from 'react';' at the top of your file.","cause":"Missing React import.","error":"'React' is not defined"},{"fix":"Ensure all routes are children of a Router component with proper nesting.","cause":"Route component not rendered correctly; missing parent Route.","error":"TypeError: Cannot read property 'path' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}