Skip to content
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

[Docs] Error display example is NOT react compiler friendly #1379

Open
iPwnPancakes opened this issue Apr 5, 2025 · 0 comments
Open

[Docs] Error display example is NOT react compiler friendly #1379

iPwnPancakes opened this issue Apr 5, 2025 · 0 comments

Comments

@iPwnPancakes
Copy link

Describe the bug

When I went to try out Tanstack Form in my existing project (Vite, React 19, Zod, React Compiler), I noticed that none of my Zod errors were even displaying! I was able to reproduce the issue along with a fix, which is basically instead of passing the entire field to the error display component, pass field.state instead.

Your minimal, reproducible example

https://stackblitz.com/edit/vitejs-vite-gc5qns8x?file=src%2Fcomponents%2FFixedFieldInfo.tsx,vite.config.ts,src%2Fcomponents%2FStaleInputField.tsx,src%2Fcomponents%2FFixedInputField.tsx,src%2Fhooks%2Fform.ts,src%2FApp.tsx,src%2Fcomponents%2FStaleFieldInfo.tsx&terminal=dev

Steps to reproduce

  1. Go to the stackblitz page
  2. Remove characters from either s until there is less than 4 characters
  3. Notice how only one shows the error

Expected behavior

I'd expect that following your examples wouldn't break if using React Compiler.

How often does this bug happen?

None

Screenshots or Videos

Image

Platform

  • OS: Ubuntu 22.04
  • Browser: Chrome

TanStack Form adapter

react-form

TanStack Form version

1.3.0

TypeScript version

~5.7.2

Additional context

No response

@iPwnPancakes iPwnPancakes changed the title [Docs] Error display is NOT react compiler friendly [Docs] Error display example is NOT react compiler friendly Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant