pretty-react-router
v1.0.8
Published
react-router management in easy way
Downloads
9
Readme
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;