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

Support for React Compiler #1030

Open
Axenu opened this issue Nov 20, 2024 · 0 comments
Open

Support for React Compiler #1030

Axenu opened this issue Nov 20, 2024 · 0 comments

Comments

@Axenu
Copy link

Axenu commented Nov 20, 2024

Describe the bug

While using this package in our react project, we needed to access the current value of one of the fields in the form, to use that to update the possible values in another field (select).

The problem is that we have the eslint-plugin-react-compiler plugin, which does not accept the form.useStore hook with the exception "Hooks must be the same function on every render, but this value may change over time to a different function.".

The UI works as expected, but it seems like the way of accessing the current value in a reactive manor is not correct according to the rules for hooks.

I added a fork of this repo, where I have added the eslint plugin. The eslint check of the useForm file fails.

Your minimal, reproducible example

https://github.com/Axenu/tanstack-form/tree/react-compiler

Steps to reproduce

  1. run ppm install
  2. npm run test:eslint

Expected behavior

There should not be any lint errors when using form.useStore

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

MacOS, eslint

TanStack Form adapter

None

TanStack Form version

0.36.2

TypeScript version

No response

Additional context

No response

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