react
react copied to clipboard
[Compiler Bug]: Error Invalid hook call
What kind of issue is this?
- [X] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
- [X] babel-plugin-react-compiler (build issue installing or using the Babel plugin)
- [ ] eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
- [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script)
Link to repro
https://codesandbox.io/p/devbox/objective-spence-zrxvd7
Repro steps
I am trying the new React 19 beta and the compiler throws an error when using the new useActionState hook and setting the formAction to the action of a form. When clicking a button, it throws this error:
Disabling the compiler, this works just fine.
If i create the function changeInput in the useActionState hook the error disappears
How often does this bug happen?
Every time
What version of React are you using?
19.0.0-beta-26f2496093-20240514