toadmilkT
tRPC2y ago
3 replies
toadmilk

how are you meant to set up client side queries?

why is there no type on the data? don't know what to do about the deprecated onSuccess stuff either.

  trpc.authCallback.useQuery(undefined, {
    onSuccess: ({success}) => {
      if (success) {
        router.push(origin ? `/${origin}` : '/dashboard');
      }
    },
    onError: (err) => {
      if (err.data?.code === 'UNAUTHORIZED') {
        router.push('/sign-in');
      }
    },


Would really appreciate if someone could help me out 🙏
image.png
Was this page helpful?