How to type onError for useMutation?

9 Replies
NekoChan
NekoChan2y 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
NekoChan2y ago
how to inferred it
cje
cje2y ago
dont write a type hover over the stuff, you will see its typed already
NekoChan
NekoChan2y 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
NekoChan2y ago
here is the type if I hover it:
NekoChan
NekoChan2y ago
nvm TRPCClientErrorLike<AppRouter> is correct
NekoChan
NekoChan2y ago
NekoChan
NekoChan2y ago
the message is string
Want results from more Discord servers?
Add your server