@houhoucoop/react-router
v1.0.1
Published
A simple react router implementation
Downloads
2
Readme
react-router
A simple react router implementation
Install
npm install --save @houhoucoop/react-router
Usage
import React from 'react'
import { Router, Switch, Route, Link } from 'react-router'
const App = () => {
return (
<>
<Router>
<ul>
<li><Link to='/'>Home</Link></li>
<li><Link to='/story'>Story</Link></li>
<li><Link to='/about/houhou'>About Houhou</Link></li>
</ul>
<Switch>
<Route path='/'>Home</Route>
<Route path='/story'>Story</Route>
<Route path='/about/:id'>
<About />
</Route>
<Route>No match</Route>
</Switch>
</Router>
</>
)
}
License
MIT © @houhoucoop