Wraps react-router + react-router-redux and provides the simplest API possible. Built for shasta, but will work in any redux application.
This is a work in progress - There is sparse documentation, no tests, and this is not on npm. Use at your own risk until we finish!
npm install shasta-router
- Import in the module
- Add it to your store's plugins
- Router state is now under
router
in your store
import { createStore, combineReducers } from 'shasta'
import * as router from 'shasta-router'
// you get the point
let store = createStore({
plugins: [ router ]
})
hook(store)
- history
- actions
- reducers
- middleware
- hook
These are all re-exported from react-router, the behavior is exactly the same. See the react-router documentation if you haven't used these before.
- Router
- Route
- Link
- Redirect
- IndexRoute
- IndexLink
- IndexRedirect