react icon indicating copy to clipboard operation
react copied to clipboard

[Compiler Bug]: Error Invalid hook call

Open Facug03 opened this issue 1 year ago • 0 comments

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:

imagen

Disabling the compiler, this works just fine.

If i create the function changeInput in the useActionState hook the error disappears

imagen

imagen

How often does this bug happen?

Every time

What version of React are you using?

19.0.0-beta-26f2496093-20240514

Facug03 avatar May 21 '24 19:05 Facug03