1.0.10 • Published 6 years ago

redux-cube-with-router-legacy v1.0.10

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

redux-cube-with-router-legacy

< Back to Project WebCube

NPM Version

Nodei

redux-cube's pluggable module for react-router's legacy version (< 4) and react-router-redux v4

npm install --save redux-cube-with-router-legacy

For react-router v4+, use redux-cube-with-router

Get Started

// xxx/App.jsx
import { createApp } from 'redux-cube';
import withRouter from 'redux-cube-with-router-legacy';

@createApp(withRouter({
  reducers: {
    // ...
  },
  // optional
  disableHashRouter: false,
  // optional
  // https://github.com/reactjs/react-router-redux#history--synchistorywithstorehistory-store-options
  routerHistoryConfig: {
    // ...
  },
  // ...
})))
class SubApp extends PureComponent {
  render() {
    const {
      routerHistoryWithStore,
    } = this.props;
    return (
      <Router history={routerHistoryWithStore}>
        <Route path="/" component={Home}>
          <Route path="foo" component={Foo}/>
          <Route path="bar" component={Bar}/>
        </Route>
      </Router>
    );
  }
}
1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago