Skip to content

Commit 07f3060

Browse files
committed
Add breaking change warning to docs
1 parent 05f5351 commit 07f3060

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

docs/api/hooks.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,24 @@ By default, this will only happen when the selector is first called. You can con
298298

299299
```tsx title="Individual hook setting"
300300
function Component() {
301-
const count = useSelector(selectCount, { stabilityCheck: 'never' })
301+
const count = useSelector(selectCount, {
302+
devModeChecks: { stabilityCheck: 'never' },
303+
})
302304
// run once (default)
303-
const user = useSelector(selectUser, { stabilityCheck: 'once' })
305+
const user = useSelector(selectUser, {
306+
devModeChecks: { stabilityCheck: 'once' },
307+
})
304308
// ...
305309
}
306310
```
307311

308-
#### `identityFunctionCheck`
312+
#### Identity Function (`state => state`) Check
313+
314+
:::danger Breaking Change!
315+
316+
This was previously referred to as `noopCheck`.
317+
318+
:::
309319

310320
In development, a check is conducted on the result returned by the selector. It warns in the console if the result is the same as the parameter passed in, i.e. the root state.
311321

@@ -330,9 +340,13 @@ By default, this will only happen when the selector is first called. You can con
330340

331341
```tsx title="Individual hook setting"
332342
function Component() {
333-
const count = useSelector(selectCount, { identityFunctionCheck: 'never' })
343+
const count = useSelector(selectCount, {
344+
devModeChecks: { identityFunctionCheck: 'never' },
345+
})
334346
// run once (default)
335-
const user = useSelector(selectUser, { identityFunctionCheck: 'once' })
347+
const user = useSelector(selectUser, {
348+
devModeChecks: { identityFunctionCheck: 'once' },
349+
})
336350
// ...
337351
}
338352
```

0 commit comments

Comments
 (0)