1.0.1 • Published 4 years ago

@houhoucoop/react-router v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-router

A simple react router implementation

NPM JavaScript Style Guide

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