Next.js Discord

Discord Forum

typescript help

Unanswered
mihir posted this in #help-forum
Open in Discord
hiii
i am using ts, zod and reacthook forms with shadcn
my zod schema has number, but it then says

Expected number, received string

can someone help me resolve this ❤️

2 Replies

@ me when typing here
i found the solution its to add
{...form.register("name", {
setValueAs: (value) => parseFloat(value),
})}
/>

to the input field