redux-arena-router
v0.3.0-alpha.1
Published
High order components of react-router based on redux-arena
Downloads
9
Maintainers
Readme
redux-arena-router-router
High order components of react-router based on redux-arena-router
Install
npm install redux-arena-router --save
Example
A complete example is under /example
directory, including a lot of HOC. And add redux-devtools for state changing show.
Online example can be found here: Here
Quick Start
- Export ArenaScene high order component for ArenaRoute using.
import { bundleToComponent } from "redux-arena/tools";
import state from "./state";
import saga from "./saga";
import * as actions from "./actions";
import PageA from "./PageA";
export default bundleToComponent({
Component: PageA,
state,
saga,
actions
})
- Pass the ArenaScene high order component as ArenaRoute's children.
import React from "react";
import { BrowserRouter, Switch } from "react-router";
import { ArenaRoute } from "redux-arena-router";
import PageA from "./pageA";
export default (props) =>
(<BrowserRouter>
<Switch>
<ArenaRoute>
<PageA />
</ArenaRoute>
</Switch>
</BrowserRouter>);