Skip to content

[pull] main from facebook:main#344

Merged
pull[bot] merged 3 commits into
LoadsAForks:mainfrom
react:main
Dec 5, 2025
Merged

[pull] main from facebook:main#344
pull[bot] merged 3 commits into
LoadsAForks:mainfrom
react:main

Conversation

@pull

@pull pull Bot commented Dec 5, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

k-yle and others added 3 commits December 4, 2025 15:28
)

## Summary

To help people access the documentation easier, we can [add
`meta.docs.url`](https://eslint.org/docs/latest/extend/custom-rules#:~:text=Specifies%20the%20URL)
to the new react-compiler rules. This allows IDEs to make the rule name
a clickable link.

## How did you test this change?

`yarn test`, `yarn prettier`, `yarn lint` and in a separate project
[using file:// URLs](https://stackoverflow.com/a/38417065)
…r errors (#35230)

Adds a new `enableUseKeyedState` compiler flag that changes the error
message for unconditional setState calls during render.

When `enableUseKeyedState` is enabled, the error recommends using
`useKeyedState(initialState, key)` to reset state when dependencies
change. When disabled (the default), it links to the React docs for the
manual pattern of storing previous values in state.

Both error messages now include helpful bullet points explaining the two
main alternatives:
1. Use useKeyedState (or manual pattern) to reset state when other
state/props change
2. Compute derived data directly during render without using state
AFAIK this is not needed to prevent any exploit but we don't really need
this. We allow functions on pretty much any other object anyway but
never on the "then" property since those would be serialized as Promises
by the client anyway.
@pull pull Bot locked and limited conversation to collaborators Dec 5, 2025
@pull pull Bot added the ⤵️ pull label Dec 5, 2025
@pull
pull Bot merged commit 3016ff8 into LoadsAForks:main Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants