This issue only occurs while running tests, it works without any bugs on emulator/physical device.
As described in Redux docs (https://react-redux.js.org/next/api/hooks#using-memoizing-selectors), using reselect's selector created outside of component and passing it to useSelector is correct approach and it shouldn't cause any issues.
Suggested solution:
Can you help us fix this issue by submitting a pull request?
react-native
orexpo
: react-nativenative-testing-library
version: 5.0.3jest-preset
: @testing-library/react-nativereact-native
version: 0.61.5node
version: 11Relevant code or config:
Not working version (with reselect and useSelector)
Working version (with useSelector)
What you did:
Testing component that uses
reselect
withuseSelector
.What happened:
When you use
useSelector
combined withreselect
's selector, it doesn't update value returned by selector on data changes.Reproduction:
Problem description:
This issue only occurs while running tests, it works without any bugs on emulator/physical device. As described in Redux docs (https://react-redux.js.org/next/api/hooks#using-memoizing-selectors), using
reselect
's selector created outside of component and passing it touseSelector
is correct approach and it shouldn't cause any issues.Suggested solution:
Can you help us fix this issue by submitting a pull request?