ui-router / redux

UI-Router plugin for Redux integration
MIT License
12 stars 6 forks source link

Plugins can only be set via props, not by manually setting them on router instance. #15

Open lenehan2 opened 3 years ago

lenehan2 commented 3 years ago

Currently, ConntectUIRouter requires plugins to be passed as a prop. This limits the ability to apply plugins exclusively by setting them on the router instance.

For example

const router = new UIRouterReact();
router.plugin(pushStateLocationPlugin);
const store = createRoutedStore(router);

const App = () => (
  <Provider store={store}>
    <ConnectedUIRouter
      router={router}
      states={states}
    >

instead of passing the pushStateLocationPlugin in via plugins prop here.

Pr https://github.com/ui-router/redux/pull/14 defaults the plugins prop to an empty array which allows users to set these manually when creating the router instance.