This is a small example to build a simple routing solution for React.js instead of using the popular React Router.
It utilizes great libraries e.g. history and universal-router which are React-independent.
The example includes:
- A singleton
historyobject for URL navigation - A
Routercomponent to route different child components - A
Linkcomponent that acts as those in React Router or in React Static Boilerplate - An example component
Appto demostrate their usages
The example is inspired mostly by You Might not need React Router.
External dependencies are listed as follows:
react: version 15.3.0history: version 4.4.0universal-router: version 2.0.0
Codes include the latest ES6/ES7 syntax e.g. function bind operator (::) and async/await.