Skip to content

Commit 6b90976

Browse files
authored
Use already extracted values instead of reading off props for controlled components (#26596)
Since `props.x` is a possibly megamorphic access, it can be slow to access and trigger recompilation. When we are looping over the props and pattern matching every key, anyway, we've already done this work. We can just reuse the same value by stashing it outside the loop in the stack. This only makes sense for updates in diffInCommitPhase since otherwise we don't have the full set of props in that loop. We also have to be careful not to skip over equal values since we need to extract them anyway.
1 parent 343a45f commit 6b90976

File tree

4 files changed

+378
-154
lines changed

4 files changed

+378
-154
lines changed

0 commit comments

Comments
 (0)