-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
[Compiler]: Consider the dispatch
fn from useActionState and useFormState to be non-reactive
#29674
Comments
For anyone interested in contributing: This requires updating Globals.ts and ObjectShape.ts:
|
dispatch from |
Hi everyone! I'd love to give this one a try if it's not assigned already |
@hieudo-dev sure, give it a try! |
Hello, I am a junior developer. Is it possible for me to participate in this issue? Open source React is very important to me. It's a library that I particularly love since I discovered it. I wish to improve my skills and learn more about it. |
Is this issue resolved ? If not i want to work on it |
… is non-reactive (#29705) Summary The dispatch function from useReducer is stable, so it is also non-reactive. the related PR: #29665 the related comment: #29674 (comment) I am not sure if the location of the new test file is appropriate😅. How did you test this change? Added the specific test compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useReducer-returned-dispatcher-is-non-reactive.expect.md.
… is non-reactive (#29705) Summary The dispatch function from useReducer is stable, so it is also non-reactive. the related PR: #29665 the related comment: #29674 (comment) I am not sure if the location of the new test file is appropriate😅. How did you test this change? Added the specific test compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useReducer-returned-dispatcher-is-non-reactive.expect.md. DiffTrain build for commit 704aeed.
The fix has been merged, thanks! |
@josephsavona The merged PR only added support for |
ooops sorry about that! |
So issue is reopened? Should I start working on it? |
See #29758 |
can i give it a try? |
Landed! |
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAwhALYAOhCmOAFAJRHAA6xRchYORA2gENcBTAGUcAnAgA0RACZ4wlSXAAWAQWGEAukQC8RKGASb8hcZIRMA3OyKduvPmggxyFqbIVKVqgGKu5LoGRggBbh5WjLaYdg6YPETmUABG5Hg4piL6REz6AHwscfbeyjhqWYQ2cQC+MXFcCbzJaRnh5Dl5eoVsHCWKZWrt1Rw17HEwCDiwxAA8ARBJYqnpmVqYesAtq5WYNUuiK22Bm9vHbvsA9PkxNSA1QA
Repro steps
Align with #29665, considering the dispatch function returned by useActionState and useFormState to be non-reactive.
This requires updating
REACT_APIS
in Globals.ts to define these hooks and their return type, and annotate the dispatch function as non-reactive. See the definition foruseState
as an example.How often does this bug happen?
Every time
What version of React are you using?
19
The text was updated successfully, but these errors were encountered: