-
-
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
equalityF is not a function #1704
Comments
Hmm. The code passes tests and looks valid when I glance at it again. It's going to be hard to investigate this without a reproduction example. |
Found it: for some reason I supplied an array as an equalityFn, probably that was an attempt for some optimization. And it didn't crash in 7.2.2. |
Its call was inside of try-catch: try {
var newSelectedState = latestSelector.current(store.getState());
if (equalityFn(newSelectedState, latestSelectedState.current)) {
return; |
I suppose we could add a couple dev-only checks to I think what might have been happening before is that it threw an error in the store subscription, but we swallow that error and always queue up a re-render for this component. Then, we re-ran the selector while rendering, it returns a result fine, no equality check, and rendering continues as usual. Now, same thing happens, but the equality check happens while rendering and explodes again. |
It would be nice to raise an exception when a |
This is the comment from prev version:
|
Yep, agreed. If you've got some time, could you try filing a PR that would throw an error if either |
Yep, will try tomorrow |
After release 7.2.3 I got error "equalityFn is not a function" in a component that beforehand worked perfect. In debugger I see that in useSelector.js in function checkForUpdates value of equalityFn is Array with one element "null":
equalityFn: Array(1)
0: null
I don't know how to reproduce it in a short example.
React: 17.0.2
ReactDOM: 17.0.2
Redux: 4.0.5
React Redux: 7.2.3
The text was updated successfully, but these errors were encountered: