It has a similar and simple features for react-router,react-rainie-router is a fast, 2kb alternative to react-router.

react-rainie-router provides a component that conditionally renders its children when the URL matches their path. It also automatically wires up elements up to the router.

Features

  • It is only 2k! , We only use our frequently used functions. Including Route Mathing, Nesting, default routing, Link, dynamic routing…
  • We can delay or prevent routing navigate by listenBefore before routing jump to another. And listenBefore should return a promise object.
  • It’s no limit to the number of Router component nested other component.
  • Support coding Spliting by getComponent from Route component.
  • It does not depend on history, but using html5 history API.

Docs & Help

  • Guides and Api docs
  • Changelog

Getting Started

Install

Using npm:

$ npm install react-rainie-router --save
Copy the code

Import what you need

The following guide assumes you have some sort of ES2015 build set up using babel and/or webpack/browserify/gulp/grunt/etc.

import  React from 'react';
import ReactDOM from 'react-dom';
import Router, { Link, listenBefore, Route } from 'react-rainie-router';Copy the code

Usage Example

How to Contribute

Anyone and everyone is welcome to contribute to this project. The best way to start is by checking our open issues, submit a new issues or feature request, participate in discussions, upvote or downvote the issues you like or dislike.