Can anyone share an example trpc mutation based onSubmit values from a form
I keep getting Hooks can only be called from React component.
6 Replies
similar thing works for creating a new row in table
It will be really helpful, if any one can share an example, thanks for checking this
GitHub
t3-credentials/RegisterForm.tsx at main · ruhap/t3-credentials
t3 stack with next-auth credential provider. Contribute to ruhap/t3-credentials development by creating an account on GitHub.
You're declaring mutation itself in function which is wrong and not needed
You can simply put your mutation at the top of your component like
And later on in your submit function .
Thanks, for sharing this. I started using react-hook-form , it looks very clean now..