react-lighthouse

1.0.1 • Public • Published

React Lighthouse

Simple React Router

Usage Example

import React from 'react';
import ReactDOM from 'react-dom';
import {Router, RoutableMixin} from 'react-lighthouse';
import ShowPage from './components/ShowPage';
import ListPage from './components/ListPage';
 
const routes = {
    'show/:id': ShowPage,
    'list': ListPage,
    '*': ListPage
}
 
const App = React.createClass({
    mixins: [
        RoutableMixin
    ],
 
    render: function () {
        return (
            <div>
                {Router(routes, this.state.route, this.state)}
            </div>
        );
    }
});
 
ReactDOM.render(<App />, document.getElementById('app'));

/react-lighthouse/

    Package Sidebar

    Install

    npm i react-lighthouse

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • sgazanchyan