hydux-react-router
ReactRouter integration for hydux.
Install
yarn add hydux hydux-react hydux-react-router # or npm i hydux hydux-react hydux-react-router
Usage
consoleconst history = // let app = withPersist<State, Actions>({// key: 'time-game/v1'// })(_app)let app = withReact<State Actions>_appapp = withReactRouter<State Actions>historyapp if processenvNODE_ENV === 'development' const devTools = default const logger = default const hmr = default app = app app = app app = app const actions = counter: Counteractions const state = counter: Counter type Actions = typeof actionstype State = typeof stateconst NoMatch = <div>404</div>const Home = <div>Home</div>const Users = <div>Users</div> const view = <main> <style>` a { margin-right: 5px; } `</style> <h1>Router example</h1> <Link to="/">Home</Link> <Link to="/users">Users</Link> <Link to="/accounts">Accounts</Link> <Link to="/counter">Counter</Link> <Link to="/404">404</Link> <ConnectedSwitch> <Route exact path="/" component=Home/> <Route path="/users" component=Users/> <Redirect from="/accounts" to="/users"/> <Route path="/counter" render= Counteractionscounter /> <Route component=NoMatch/> </ConnectedSwitch> </main> state actions view
Counter App
git clone https://github.com/hydux/hydux-react.gitcd examples/counteryarn # or npm i npm start
Now open http://localhost:8080 and hack!
` License
MIT