-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
Do you want to request a feature or report a bug?
bug
The useSelector API reference states two things that contradict each other:
- When an action is dispatched,
useSelector()will do a shallow comparison of the previous selector result value and the current result value. If they are different, the component will be forced to re-render. If they are the same, the component will not re-render. useSelector()uses strict===reference equality checks by default, not shallow equality (see the following section for more details).
What is the current behavior?
useSelector() uses strict === reference equality checks by default, not a shallow comparison.
What is the expected behavior?
The docs should probably be amended to say something like this instead:
- When an action is dispatched,
useSelector()willdo a shallow comparison ofcompare the previous selector result value and the current result value. If they are deemed different, the component will be forced to re-render.If they are the sameOtherwise, the component will not re-render.
Metadata
Metadata
Assignees
Labels
No labels