You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-static-router

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-static-router

A tiny and simple static router for React.

0.2.2
latest
development
Source
npmnpm
Version published
Weekly downloads
5
400%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

react

FAQs

Package last updated on 31 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts