1.0.5 • Published 8 years ago
react-enhanced-route v1.0.5
react-enhanced-route
react-enhanced-route allows you to create react routes with custom layouts and routes which require authentication.
Getting started
Install and add package as dependency by running one of below commands.
Using npm:
npm install react-enhanced-routeUsing yarn:
yarn add react-enhanced-routeImport package and follow the examples below:
import {EnhancedRoute as Route} from 'react-enhanced-route'Examples
Create route with custom layout
<Route path="/home" component={HomePage} layout={MainLayout} />Create protected route
<Route path="/admin" auth={isAuthorized} component={AdminPage} />Create protected route with redirection and layout
<Route path="/admin" auth={isAuthorized} redirect={'/login'} component={AdminPage} layout={AdminLayout} />For live examples click below:
License
MIT