microsoft / redux-dynamic-modules

Modularize Redux by dynamically loading reducers and middlewares.
https://redux-dynamic-modules.js.org
MIT License
1.07k stars 116 forks source link

React redux dependency issue ReactReduxContext Consumer is null #144

Open skmasq opened 4 years ago

skmasq commented 4 years ago

I'm using parcel for building my application and I had this issue https://github.com/reduxjs/react-redux/issues/1489, in short, the application has react-redux/lib and react-redux/es running at the same time, and my ReactReduxContext was returning null value, because I was accessing the wrong import.

Issue was solved in my application by adding following alias to my module-resolver forcing all imports resolve to

"babel": {
        "plugins": [
            [
                "module-resolver",
                {
                    "alias": {
                        "react-redux": "react-redux/lib"
                    }
                }
            ]
        ]
    },

I ran into the same issue with this library and I fixed it by manually changing the require("react-redux") to require("react-redux/lib"). Do you have any suggestion how to best go about fixing this issue without manual file editing?