Query hooks automatically begin fetching data as soon as the component is mounted. But, there are use cases where you may want to delay fetching data until some condition becomes true. RTK Query supports conditional fetching to enable that behavior.
If you want to prevent a query from automatically running, you can use the skip
parameter in a hook.
tip
Typescript users may wish to use skipToken
as an alternative to the skip
option in order to skip running a query, while still keeping types for the endpoint accurate.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4