dillon1000/react
Commit
Browse files 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.
Changed paths4 files
First-parent comparisonpackages/react-dom-bindings/src/client/ReactDOMComponent.js ModifiedM packages/react-dom-bindings/src/client/ReactDOMInput.js ModifiedM packages/react-dom-bindings/src/client/ReactDOMSelect.js ModifiedM packages/react-dom-bindings/src/client/ReactDOMTextarea.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…