Skip to content
Branch: master
Go to file

Latest commit

FelixSchuSi committed fcc8f85 Apr 22, 2020
The same sentence appears twice in a row in this document.
On the first occasion it is used in a block spaced paragraph, directly thereafter it is used in a standard paragraph.
I assume that this is not intetional and suggest to remove the one in the standard paragraph.


Failed to load latest commit information.


npm version License: MIT Build Status Join the chat at styled with prettier

Official website:

router5 is a framework and view library agnostic router.

  • view / state separation: router5 processes routing instructions and outputs state updates.
  • universal: works client-side and server-side
  • simple: define your routes, start to listen to route changes
  • flexible: you have control over transitions and what happens on transitions
import createRouter from 'router5'
import browserPlugin from 'router5-plugin-browser'

const routes = [
  { name: 'home', path: '/' },
  { name: 'profile', path: '/profile' }

const router = createRouter(routes)



With React (hooks)

import React from 'react'
import ReactDOM from 'react-dom'
import { RouterProvider, useRoute } from 'react-router5'

function App() {
  const { route } = useRoute()

  if (!route) {
    return null

  if ( === 'home') {
    return <h1>Home</h1>

  if ( === 'profile') {
    return <h1>Profile</h1>

  <RouterProvider router={router}>
    <App />

With observables

Your router instance is compatible with most observable libraries.

import { from } from 'rxjs/observable/from'

from(router).map(({ route }) => {
  /* happy routing */



You can’t perform that action at this time.