Skip to content

[pull] main from facebook:main#492

Merged
pull[bot] merged 1 commit intocode:mainfrom
facebook:main
Feb 25, 2026
Merged

[pull] main from facebook:main#492
pull[bot] merged 1 commit intocode:mainfrom
facebook:main

Conversation

@pull
Copy link

@pull pull bot commented Feb 25, 2026

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 : )

If a function is known to freeze its inputs, and captures refs, then we
can safely assume those refs are not mutated during render.

An example is React Native's PanResponder, which is designed for use in
interaction handling. Calling `PanResponder.create()` creates an object
that shouldn't be interacted with at render time, so we can treat it as
freezing its arguments, returning a frozen value, and not accessing any
refs in the callbacks passed to it. ValidateNoRefAccessInRender is
updated accordingly - if we see a Freeze <place> and ImmutableCapture
<place> for the same place in the same instruction, we know that it's
not being mutated.

Note that this is a pretty targeted fix. One weakness is that we may not
always emit a Freeze effect if a value is already frozen, which could
cause this optimization not to kick in. The worst case there is that
you'd just get a ref access in render error though, not miscompilation.
And we could always choose to always emit Freeze effects, even for
frozen values, just to retain the information for validations like this.
@pull pull bot locked and limited conversation to collaborators Feb 25, 2026
@pull pull bot added the ⤵️ pull label Feb 25, 2026
@pull pull bot merged commit e33071c into code:main Feb 25, 2026
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.

1 participant