New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-route

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-route

tiny react router thats less opinionated than react-router

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

react-route

Simple, tiny router for React.

<div className = 'Home'>
  <Route path = '/'>
    <div>Index /</div>
  </Route>
  <Route path = '/about'>
    About me
  </Route>
  <Route path = '/user/:user'>
    <User />
    <Route path = '/user/amy'>
      Hi amy!
    </Route>
  </Route>
</div>

Features

  • Parameter support via props.params
  • Simple API for navigating pages
  • HTML5 History Support
  • No wrapping handlers
  • Nesting

Installation

npm install react-route

API

<Route path='...' />

Specify an express-style path. For a list of possibilities check out: https://github.com/pillarjs/path-to-regexp

Any child components will receive a params property based on the pathname and keys provided.

<p>
  Welcome user {this.props.params.user}
</p>

Route.go(path)

Navigate to path and re-render the routes.

onclick () {
  Route.go('/user/amy');
}

License

MIT

Keywords

react

FAQs

Package last updated on 24 Sep 2015

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