Socket
Book a DemoInstallSign in
Socket

react-enhanced-route

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-enhanced-route

React Enhanced Route - define custom layouts for your routes, prevent from accessing protected routes!

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

react-enhanced-route

npm version CircleCI branch npm license

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-route

Using yarn:

yarn add react-enhanced-route

Import 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:

Edit react-enhanced-route example

License

MIT

Keywords

react

FAQs

Package last updated on 19 Nov 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.