T3 Stack · Hook
useMutation
useMutation creates a tRPC mutation hook for changing server data. Its callbacks can update cached data, undo failed optimistic updates, and refresh related queries.
Last updated
Syntax
trpc.<router>.<procedure>.useMutation(options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
useQueryuseContextonMutateonErroronSettledinvalidatesetDatagetData