makeomatic/redux-connect

add react-router middleware

开放

#67 创建于 2016年9月7日

 (0 条评论) (0 个反应) (0 位负责人)JavaScript (73 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (550 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

The README.md gives an example of how you can use this with applyRouterMiddleware. Would it make more sense to provide your own middleware instead? Might look something like:

const useReduxAsyncConnect = (helpers, filters) => ({
  renderRouterContext: (child, props) => (
    <ReduxAsyncConnect helpers={helpers} filters={filters} {...props}>{child}</ReduxAsyncConnect>
  )
})

and would be used like

const component = (
  <Router
    render={(props) => applyRouterMiddleware(useReduxConnect(helpers, filters), useScroll())}
    history={history}
    routes={getRoutes(store)}
  />
);

贡献者指南