We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 70a167e + 54d8096 commit 8cf538cCopy full SHA for 8cf538c
docs/api/hooks.md
@@ -100,6 +100,18 @@ import { shallowEqual, useSelector } from 'react-redux'
100
const selectedData = useSelector(selectorReturningObject, shallowEqual)
101
```
102
103
+- Use a custom equality function as the `equalityFn` argument to `useSelector()`, like:
104
+
105
+```js
106
+import { useSelector } from 'react-redux'
107
108
+// equality function
109
+const customEqual = (oldValue, newValue) => oldValue === newValue
110
111
+// later
112
+const selectedData = useSelector(selectorReturningObject, customEqual)
113
+```
114
115
The optional comparison function also enables using something like Lodash's `_.isEqual()` or Immutable.js's comparison capabilities.
116
117
### `useSelector` Examples
0 commit comments