Skip to content

Latest commit

 

History

History
67 lines (56 loc) · 1.18 KB

Installed.md

File metadata and controls

67 lines (56 loc) · 1.18 KB

Install

Node

Install React-Keeper

npm install react-keeper

Then use as this:

import { HashRouter, Route, Link } from 'react-keeper'
// import react, Home, Host...

const App = ()=>{
  return (
    <HashRouter>
      <div>
        <ul>
          <li><Link to='/'>Home</Link></li>
          <li><Link to='/host'>Host</Link></li>
        </ul>
        <div>
          <Route path='/' components={Home}/>
          <Route path='/host' components={Host}/>
        </div>
      </div>
    </HashRouter>
  )
}
ReactDOM.render(<App/>, document.getElementById('app'))

Browser

Lead into html:

<script src='react-keeper.min.js'></script>

Then use as this:

var HashRouter = ReactKeeper.HashRouter,
  Route = ReactKeeper.Route,
  Link = ReactKeeper.Link

var App = function(){
  return (
    <HashRouter>
      <div>
        <ul>
          <li><Link to='/'>Home</Link></li>
          <li><Link to='/host'>Host</Link></li>
        </ul>
        <div>
          <Route path='/' components={Home}/>
          <Route path='/host' components={Host}/>
        </div>
      </div>
    </HashRouter>
  )
}
ReactDOM.render(<App/>, document.getElementById('app'))