1.0.16 • Published 7 years ago

react-router-private v1.0.16

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

react-router-private

Private route component for React & React Router

NPM

Install

npm install --save react-router-private

TODO

Add example

Usage

import React, { Component } from 'react'
import { BrowserRouter as Router, Route } from 'react-router-dom'
...
import PrivateRoute from 'react-router-private'

class Example extends Component {
  render () {
    return (
    <div className="app" >
      <Router>
        <Route path ="/" exact component={home}></Route>
        <PrivateRoute path="/profile" exact component={Profile} authStatus={this.state.authStatus} redirectURL="/login"/>
        <PrivateRoute path="/another-route" component={Profile} authStatus={this.state.authStatus} nonLoggedInComponent={AlternativeComponent} />
      </Router>
    </div>
    )
  }
}

License

MIT © barisozcetin

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago