0.2.2 • Published 7 years ago

react-static-router v0.2.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

React Static Router

A tiny and simple static router for React.

Installation

Install using the NPM:

npm install -S react-static-router@development

Usage Example

For more detailed example see the website folder. The site was built to be self explainable and also an example.

/**
 * This router is designed to work only with promises,
 * so the "System.import" and Webpack 2 will fit well in a real situation.
 */

import React from 'react';
import ReactDOM from 'react-dom';
import Router from 'react-static-router';

const Landing = () => {
  return (
    <div>Landing</div>
  );
};

const routes = [{
  pattern: '/',
  getComponent() {
    return new Promise(resolve => resolve(Landing));
  }
}];

ReactDOM.render((
  <Router pathname={ window.location.pathname } routes={ routes } />
), document.getElementById('root'));

License

MIT

0.3.2

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago