1.0.8 • Published 5 years ago

pretty-react-router v1.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Table of Contents

Installation

yarn add pretty-react-router --save

Usage

routes.js
import React from 'react';
import { Router } from 'pretty-react-router';

Router.route('/login', SignIn);
Router.route('/forgot-password', ForgotPassword);
Router.route('/logout', () => 'logout');

Router.group('/dashboard', dashboard => {
    dashboard.route('/', Dashboard);
    dashboard.route('/statistics', Statistics);
});

Router.route('/make-order', (props) => {
    return 'Make order page';
});

Router.fallback(NotFoundPage);
App.js
import React from 'react';
import { Switch } from 'pretty-react-router';
import { BrowserRouter } from 'react-router-dom';

const App = () => {
    return (
         <BrowserRouter>
             <Switch />
         </BrowserRouter>
    );
}

export default App;

License

MIT

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago