How to type onError for useMutation?

9 Replies
NekoChan
NekoChanOP2y ago
I tried TRPCClientErrorLike<AppRouter> and there's no type error, but the type is wrong.
cje
cje2y ago
you dont need to type it its all inferred
NekoChan
NekoChanOP2y ago
how to inferred it
cje
cje2y ago
dont write a type hover over the stuff, you will see its typed already
NekoChan
NekoChanOP2y ago
I want to write the onError function outside of the useMutation options, so I want to know how to type or inferred it
NekoChan
NekoChanOP2y ago
here is the type if I hover it:
NekoChan
NekoChanOP2y ago
nvm TRPCClientErrorLike<AppRouter> is correct
NekoChan
NekoChanOP2y ago
NekoChan
NekoChanOP2y ago
the message is string
Want results from more Discord servers?
Add your server