How to get TRPC mutation type?

Does anyone know how to get the useMutation return type for a TRPC mutation?

I want to pass a mutation down as props but cannot get the types working

const mutationResult = api.myRouter.createPost.useMutation() // What type is this?

// Type error
return <Child mutationResult={mutationResult} />
Was this page helpful?