reactql / kit

ReactQL starter kit (use the CLI)
https://reactql.org
228 stars 38 forks source link

Any plans to added ConnectedRouter? #124

Closed tsdexter closed 6 years ago

tsdexter commented 6 years ago

@leebenson are there any plans to add ConnectedRouter from react-router-redux - I have to make quite a few changes in the kit files to get it working.

I've been using it so I can dispatch routing actions like dispatch(push('/new-route')) - is there a different way to do this using the BrowserRouter included in the kit that I'm unaware of.

leebenson commented 6 years ago

Apologies for the slow response to this thread. In kit 3.0, it will be possible to add arbitrarily HOCs to wrap the main component, so this should make it pretty simple to augment the existing config without digging too deep down into config files.

Take a look at this comment to see the general approach to kit 3.0.

With that said, according to https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux, it looks like it might already be possible to do this in userland by simply importing routerReducer and using it via config.addReducer(), and exporting your main component wrapped in <ConnectedRouter history={history}> -- which you can import from kit/lib/routing.js.

Have you tried that?