tRPCttRPC
Powered by
Teodorant, Tech-PriestT
tRPC•2y ago•
1 reply
Teodorant, Tech-Priest

Cannot use usemutation in my nextjs/t3 project

I have this code
 const mutation = api.auth.addaccount.useMutation();
  const handleLogin = async (email: string, password: string) => {
    await mutation({ email: email, password: password });
  };
 const mutation = api.auth.addaccount.useMutation();
  const handleLogin = async (email: string, password: string) => {
    await mutation({ email: email, password: password });
  };


usemutation is underlined with wavy red and has this error when I hover over it "Property 'useMutation' does not exist on type 'DecorateProcedure<MutationProcedure<{ input: { email: string; password: string; }; output: string; }>>'.ts(2339)
"
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Nextjs 16 use cache
VilianVVilian / ❓-help
3mo ago
how to connect trpc server (t3 stack) from my external nextjs app?
gimbledevGgimbledev / ❓-help
3y ago