Creating an update mutation with tRPC
Hi everyone, I'm trying to use an update mutation in this way:
But when trying to call it here:
I get squiggly lines under
id: myId
saying the following:
It seemed to me that I was supposed to use the useMutation in the same way as UseQuery, but this does not seem to work. Anyone know how this is supposed to be done? My apologies if this is a nooby question, I am quite new to web developmentK
korgko•367d ago
Hey!
What you're trying to do is to call the
useMutation
hook itself from inside of a function, and inside your submit function call the mutate
property in order to execute your mutation.
Here is an example of how it should look like:
21KMembers
View on DiscordWant results from more Discord servers?
More PostsCreate and Download PDFI have a web app that allows users to edit a table including drag/dropping rows, change row colors, Is it possible to pass a zod schema as a prop?I have this
```ts
interface Props {
schema: ZodSchema;
children: React.ReactNode;
defaulLoading state of a `'use server'` componentIs it possible to have a loading state for e.g. a form submission using the new `use server` directiHow do you self host your projects in a vpswithout relying on any cpanel or vercel,
i have a vps and i usually move the project using git and