Skip to content

Commit

Permalink
Update on "[compiler] Exclude refs and ref values from having mutable…
Browse files Browse the repository at this point in the history
… ranges"

Summary:
Refs, as stable values that the rules of react around mutability do not apply to, currently are treated as having mutable ranges, and through aliasing, this can extend the mutable range for other values and disrupt good memoization for those values. This PR excludes refs and their .current values from having mutable ranges.

Note that this is unsafe if ref access is allowed in render: if a mutable value is assigned to ref.current and then ref.current is mutated later, we won't realize that the original mutable value's range extends.

[ghstack-poisoned]
  • Loading branch information
mvitousek committed Aug 16, 2024
1 parent ca429de commit 23625a8
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 23625a8

Please sign in to comment.