State Management · Middle · Question 36 of 75
How do you skip an RTK Query request until an argument is available?
- ✓Correct answer: Pass
skip: !idor theskipTokeninstead of the argument - 2Wrap the hook call in
if (id) - 3Return
nullfrom the endpoint'squeryfunction
Explanation
useGetUserQuery(id ?? skipToken) keeps the hook call unconditional while preventing the request. It's the counterpart of enabled: false in TanStack Query.