Skip to content

[bug]: A Simple form is not returning form values on submit #7183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
divyaYK opened this issue Apr 12, 2025 · 1 comment
Open
2 tasks done

[bug]: A Simple form is not returning form values on submit #7183

divyaYK opened this issue Apr 12, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@divyaYK
Copy link

divyaYK commented Apr 12, 2025

Describe the bug

I'm using the latest Next.js, TailwindCSS, and ShadCN packages. I wrote a simple form following the documentation provided on ShadCN docs.

When I log the values of the form using form.getValues(), I'm receiving the form values but when I click on the submit button, the form values are undefined.

Affected component/components

Form, FormField, FormControl

How to reproduce

  1. Run npx create-next-app@latest
  2. Install Shadcn
  3. Install react-hook-form and Zod
  4. Write a simple form component as per the docs and click on the submit button

Codesandbox/StackBlitz link

https://codesandbox.io/p/devbox/t3px56

Logs

{formData: {email: undefined}}

System Info

Dependencies:
"@hookform/resolvers": "^5.0.1",
"@radix-ui/react-label": "^2.1.3",
"@radix-ui/react-slot": "^1.2.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"next": "15.3.0",
"postcss": "^8.5.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.55.0",
"tailwind-merge": "^3.2.0",
"tw-animate-css": "^1.2.5",
"zod": "^3.24.2"

Node version: v20.11.1
npm version: 10.2.4

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@divyaYK divyaYK added the bug Something isn't working label Apr 12, 2025
@hedbladucf
Copy link

Happening to me too. I thought i was losing my mind. At least for me, its only happening with fields that use <Input {...field} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants