TanStackT
TanStack5mo ago
1 reply
hidden-sapphire

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?
Was this page helpful?