-
Notifications
You must be signed in to change notification settings - Fork 50.2k
[compiler] Add enableVerboseNoSetStateInEffect to suggest options to user/agent #35306
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
+365
−21
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…user/agent The current `validateNoSetStateInEffects` error has potential false positives because we cannot fully statically detect patterns where calling setState in an effect is actually valid. This flag `enableVerboseNoSetStateInEffect` adds a verbose error mode that presents multiple possible use-cases, allowing an agent to reason about which fix is appropriate before acting: 1. Non-local derived data - suggests restructuring state ownership 2. Derived event pattern - suggests requesting an event callback from parent 3. Force update / external sync - suggests using `useSyncExternalStore` This gives agents the context needed to make informed decisions rather than blindly applying a fix that may not be correct for the specific situation.
github-actions bot
pushed a commit
that referenced
this pull request
Dec 8, 2025
…user/agent (#35306) The current `validateNoSetStateInEffects` error has potential false positives because we cannot fully statically detect patterns where calling setState in an effect is actually valid. This flag `enableVerboseNoSetStateInEffect` adds a verbose error mode that presents multiple possible use-cases, allowing an agent to reason about which fix is appropriate before acting: 1. Non-local derived data - suggests restructuring state ownership 2. Derived event pattern - suggests requesting an event callback from parent 3. Force update / external sync - suggests using `useSyncExternalStore` This gives agents the context needed to make informed decisions rather than blindly applying a fix that may not be correct for the specific situation. DiffTrain build for [3640f38](3640f38)
github-actions bot
pushed a commit
that referenced
this pull request
Dec 8, 2025
…user/agent (#35306) The current `validateNoSetStateInEffects` error has potential false positives because we cannot fully statically detect patterns where calling setState in an effect is actually valid. This flag `enableVerboseNoSetStateInEffect` adds a verbose error mode that presents multiple possible use-cases, allowing an agent to reason about which fix is appropriate before acting: 1. Non-local derived data - suggests restructuring state ownership 2. Derived event pattern - suggests requesting an event callback from parent 3. Force update / external sync - suggests using `useSyncExternalStore` This gives agents the context needed to make informed decisions rather than blindly applying a fix that may not be correct for the specific situation. DiffTrain build for [3640f38](3640f38)
This was referenced Dec 9, 2025
unstubbable
pushed a commit
to vercel/next.js
that referenced
this pull request
Dec 10, 2025
[diff facebook/react@378973b3...55480b4d](facebook/react@378973b...55480b4) <details> <summary>React upstream changes</summary> - facebook/react#35317 - facebook/react#35306 - facebook/react#35285 - facebook/react#35316 - facebook/react#35313 - facebook/react#35308 - facebook/react#35284 - facebook/react#35296 </details>
github-actions bot
pushed a commit
to code/lib-react
that referenced
this pull request
Dec 12, 2025
…user/agent (facebook#35306) The current `validateNoSetStateInEffects` error has potential false positives because we cannot fully statically detect patterns where calling setState in an effect is actually valid. This flag `enableVerboseNoSetStateInEffect` adds a verbose error mode that presents multiple possible use-cases, allowing an agent to reason about which fix is appropriate before acting: 1. Non-local derived data - suggests restructuring state ownership 2. Derived event pattern - suggests requesting an event callback from parent 3. Force update / external sync - suggests using `useSyncExternalStore` This gives agents the context needed to make informed decisions rather than blindly applying a fix that may not be correct for the specific situation. DiffTrain build for [3640f38](facebook@3640f38)
github-actions bot
pushed a commit
to code/lib-react
that referenced
this pull request
Dec 12, 2025
…user/agent (facebook#35306) The current `validateNoSetStateInEffects` error has potential false positives because we cannot fully statically detect patterns where calling setState in an effect is actually valid. This flag `enableVerboseNoSetStateInEffect` adds a verbose error mode that presents multiple possible use-cases, allowing an agent to reason about which fix is appropriate before acting: 1. Non-local derived data - suggests restructuring state ownership 2. Derived event pattern - suggests requesting an event callback from parent 3. Force update / external sync - suggests using `useSyncExternalStore` This gives agents the context needed to make informed decisions rather than blindly applying a fix that may not be correct for the specific situation. DiffTrain build for [3640f38](facebook@3640f38)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current
validateNoSetStateInEffectserror has potential false positives becausewe cannot fully statically detect patterns where calling setState in an effect is
actually valid. This flag
enableVerboseNoSetStateInEffectadds a verbose error mode that presents multiple possibleuse-cases, allowing an agent to reason about which fix is appropriate before acting:
useSyncExternalStoreThis gives agents the context needed to make informed decisions rather than
blindly applying a fix that may not be correct for the specific situation.