Recommended approach to type-narrowing `useMutationState`?
I'm trying to get the strictly-typed mutation state of a specific mutation that's performed on a previous page but not sure if there's an elegant way of doing this with
useMutationState
. From what I can tell, query uses a wide type because it's pretty difficult to infer the actual mutation state type based on the options for useMutationState
, which is understandable.
What's the recommended approach in this case? Do manual narrowing in the predicate
or select
options?1 Reply
correct-apricotOP•17h ago
hm i guess this is the relevant github issue: https://github.com/TanStack/query/issues/6843