Skip to content

Conversation

josephsavona
Copy link
Member

@josephsavona josephsavona commented Aug 22, 2024

Stack from ghstack (oldest at bottom):

If you have a function expression which captures a mutable value (but does not mutate it), and that function is invoked during render, we infer the invocation as a mutation of the captured value. But in some circumstances we can prove that the captured value cannot have been mutated, and could in theory avoid inferring a mutation.

If you have a function expression which _captures_ a mutable value (but does not mutate it), and that function is invoked during render, we infer the invocation as a mutation of the captured value. But in some circumstances we can prove that the captured value cannot have been mutated, and could in theory avoid inferring a mutation.

[ghstack-poisoned]
Copy link

vercel bot commented Aug 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 0:36am

josephsavona added a commit that referenced this pull request Aug 22, 2024
If you have a function expression which _captures_ a mutable value (but does not mutate it), and that function is invoked during render, we infer the invocation as a mutation of the captured value. But in some circumstances we can prove that the captured value cannot have been mutated, and could in theory avoid inferring a mutation.

ghstack-source-id: 47664e4
Pull Request resolved: #30783
@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Aug 22, 2024
@josephsavona josephsavona merged commit a9752f9 into gh/josephsavona/40/base Aug 22, 2024
19 checks passed
josephsavona added a commit that referenced this pull request Aug 22, 2024
If you have a function expression which _captures_ a mutable value (but does not mutate it), and that function is invoked during render, we infer the invocation as a mutation of the captured value. But in some circumstances we can prove that the captured value cannot have been mutated, and could in theory avoid inferring a mutation.

ghstack-source-id: 47664e4
Pull Request resolved: #30783
@josephsavona josephsavona deleted the gh/josephsavona/40/head branch August 22, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants