tiny-react-router
Very small and basic router for React
Last updated 3 months ago by asbjornenge .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tiny-react-router 
SYNC missed versions from official npm registry.

tiny react router

Very small (30 lines of es6) and basic router for react.
You probably want to use react-router.

Install

npm install --save tiny-react-router

Use

import React  from 'react'
import { Router } from 'tiny-react-router'
import Home   from './screens/Home'
import Blog   from './screens/Blog'

let routes = {
    '/'         : Home,
    '/blog/:id' : Blog
}

React.render(
    <Router routes={routes} />,
    document.body
)

Changelog

2.0.0

  • Major rewrite using ES6 features and no babel
  • Exporting { Router, nav, getPath }
  • No default export

1.0.2

  • Removing event listener on componentWillUnmount and keeping track of mounted state
  • Only trying to setState when mounted

1.0.1

  • Using window.addEventListener instead of stealing window.onhashchange

1.0.0

  • Initial release :tada:

enjoy.

Current Tags

  • 2.0.0                                ...           latest (3 months ago)

4 Versions

  • 2.0.0                                ...           3 months ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |