T
TanStack3y ago
equal-aqua

React 18 experimental use() hook

Is it possible to implement the new use() hook in queryFn? Or will it just be redundant? Thanks!
3 Replies
harsh-harlequin
harsh-harlequin3y ago
How would you use it? As far as I know, use() is a hook so it wouldn't work inside a regular function?
equal-aqua
equal-aquaOP3y ago
use() is special in that it can be used inside functions, or if statements. It's pretty neat
harsh-harlequin
harsh-harlequin3y ago
Interesting. I knew it could be used conditionally but didn't know it could be used inside functions. I would think it's redundant to call it inside the query function but I could be wrong. I'd be curious to see it working.

Did you find this page helpful?