redux-dynamic-modules
redux-dynamic-modules copied to clipboard
Middleware removed if added as enhancer
Hi there,
I'm currently changing over a website to use redux-dynamic-modules. It also uses react-router which lead me to the following problem. It seems, middleware that gets added as an enhancer is removed, potentially by the middleware handler. This code works:
export const store = createStore({
initialState: {},
extensions: [{
middleware: [routerMiddleware]
}]
}, getLegacyModule())
while this one doesn't:
export const store = createStore({
initialState: {},
enhancers: [applyMiddleware(routerMiddleware)]
}, getLegacyModule())
Specifically the middleware in the second case gets only some events and then doesn't get any events from Redux.
Not sure if this is intended, but if it is, it would be good to document it.
Did you solve this issue?
We are still using an extension. I'm currently thinking about setting up a redux-first-history extension.