I'm upgrading a legacy project to React 16.14. We aren't ready to go to React 17 or 18 since it would cause too many breaking changes.
I'm upgrading redux and react-redux as well, using version 8.1.2 of react-redux which officially supports React version 16.
However, react-redux has a dependency tree like this:
└─┬ react-redux@8.1.2
└─┬ @types/hoist-non-react-statics@3.3.1
└── @types/react@18.2.21
The problem comes from the conflict between the types used by @types/hoist-non-react-statics (react types version 18.2.21) and the react types of my project (version 16.14).
I get 176 compiler errors!
Even version 7 or react-reduct depends on the @types/hoist-non-react-statics@3.3.1 so I can't downgrade it.
Does anybody know a good way to fix this. I've read that I might be able to use the "resolutions" field if I use yarn for package management. I'd rather use npm unless its impossible to solve another way. I also haven't tried the yarn solution yet, so if anybody can vouch for that and explain how it works that could also be helpful.