-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useIsomorphicLayoutEffect
cannot pass test cases in non-web environment
#1436
Comments
No one has yet filed actual bugs reporting this doesn't work in React Native. Do you have any actual test cases that show it fails in an RN app? |
😂Bug happened here #1437 |
B.T.W. I think it worth to add unit tests for RN because users did use |
Yep, but I wasn't sure how to try to add RN unit tests at the time. |
How about @testing-library/react-native ? |
Fixed by #1444 . |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
Report a bug.
What is the current behavior?
react-redux/src/hooks/useSelector.js
Lines 22 to 27 in 2eac861
react-redux/src/components/connectAdvanced.js
Lines 40 to 45 in 6725400
These two files implement the
useIsomorphicLayoutEffect
hook to prevent the React warning by usinguseEffect
instead ofuseLayoutEffect
. But it could break on non-web environment, like React Native, and etc.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:
I tested by these steps:
react-redux
repouseIsomorphicLayoutEffect
toconst useIsomorphicLayoutEffect = useEffect
npx jest
What is the expected behavior?
react-native
in jest.useIsomorphicLayoutEffect
and fix it if there did have some bugs.Which 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?
[email protected]
cc
@byunicorn
The text was updated successfully, but these errors were encountered: