Closed mprast closed 5 years ago
We do have a sort-of hard dependency on either react-dom
or react-native
, due to our need to use the unstable_batchedUpdates
API they both export.
For other renderers, you'll need to use the "react-redux/alternate-renderers"
entry point. It looks like we don't have that formally listed in the documentation atm, but you can see a description in the v7 release notes:
Closing to track in #1458
oh, 'alternate-renderers' looks like what I needed. Thank you!
@mprast sure! Please let us know if you have any issues using that - I'm not sure how many people have actually used it for real :) But, yeah, that's exactly why we added it.
Do you want to request a feature or report a bug? report a bug (If this is a usage question, please do not post it here—post it on Stack Overflow instead. If this is not a “feature” or a “bug”, or the phrase “How do I...?” applies, then it's probably a usage question.)
What is the current behavior? I'm trying to use react-redux with ink and yarn v2. When I attempt to import
Provider
I'm met with the following:I'm guessing it's because react-redux is trying to do a static import here: https://github.com/reduxjs/react-redux/blob/5e6205a2f9bb18e1f8b0163382bc29230ea7d3d3/src/index.js#L11
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to a CodeSandbox (https://codesandbox.io/s/new) or RN Snack (https://snack.expo.io/) example below:
demo: https://codesandbox.io/s/festive-leftpad-cjr2w
What is the expected behavior? I'm expecting to be able to use Redux without react-dom or react-native, since the impression I got from the docs is that react-redux doesn't or shouldn't have hard dependencies on a particular rendering library (if I'm mistaken and didn't miss something obvious it might be a good idea to add a disclaimer to the README!)
For now I can add
react-dom
as an easy workaround, but it'd be nice not to have the extra dependency just so I can import Provider and connectWhich versions of React, ReactDOM/React Native, Redux, and React Redux are you using? Which browser and OS are affected by this issue? Did this work in previous versions of React Redux? React: 16.11.0 ReactDOM/React Native: N/A ink: 2.5.0 Redux: 4.0.4 React Redux: 7.1.3