redux-cube-with-router

1.2.0 • Public • Published

redux-cube-with-router

< Back to Project WebCube

NPM Version

Nodei

redux-cube's pluggable module for react-router v4+

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

Get Started

// xxx/App.jsx
import { createApp } from 'redux-cube';
import withRouter from 'redux-cube-with-router';
import { Route } from 'react-router-dom';
 
@createApp(withRouter({
  reducers: {
    // ...
  },
  // optional
  // https://github.com/ReactTraining/history#usage
  supportHtml5History: false,
  // optional
  // https://github.com/ReactTraining/react-router/blob/master/packages/react-router-redux/modules/ConnectedRouter.js#L8
  routerConfig: {},
  // ...
})))
class SubApp extends PureComponent {
  render() {
    return (
      <Route path="/" component={Home}>
        <Route path="foo" component={Foo}/>
        <Route path="bar" component={Bar}/>
      </Route>
    );
  }
}

/redux-cube-with-router/

    Package Sidebar

    Install

    npm i redux-cube-with-router

    Weekly Downloads

    3

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    11.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • dexteryy