Just a router for react

Usage no npm install needed!

<script type="module">
  import chrstntddRouter from 'https://cdn.skypack.dev/@chrstntdd/router';



Build Status Size Coverage Status

Just a router for react

WARNING 🏗 This router is in active development and is not fully tested or documented...yet 🚧


  • 🛠 Hooks and functions all the way down — no ES6 classes to be found
  • 🌳 Tree-shakable (ESM w/ no side effects)
  • 🚫 0 dependencies
  • 🐜 Tiny footprint
  • 🚟 Suspense aware
  • 📘 TypeScript friendly

Prior Art / Credit

This router began as a fork of @reach/router so the API is about the same.


With npm

$ npm install @chrstntdd/router

With yarn

$ yarn add @chrstntdd/router

Basic Example

import React from 'react'
import ReactDOM from 'react-dom'

import { Router, Link } from '@chrstntdd/router'

function Loading() {
  return <div>Loading...</div>

function FallbackRoute() {
  return (
      <h1>Route not found</h1>
      <br />
      <Link to="/">Back home</Link>

const Home = React.lazy(() => import(/* webpackChunkName: "home" */ './Home'))
const PageTwo = React.lazy(() => import(/* webpackChunkName: "page-two" */ './PageTwo'))

function App() {
  return (
      <React.Suspense fallback={<Loading />}>
            <Home path="/" />
            <PageTwo path="/page-two" />
            <FallbackRoute default />

ReactDOM.render(<App />, document.getElementById('root'))


The published code depends on Object.assign() support and requestAnimationFrame. If your environment does not support these browser features, then you must provide your own polyfills.

React ships with an Object.assign() polyfill. source