mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
ReactDOMComponent optimization
Slight optimization to not do unneeded reconciles of DOM components
This commit is contained in:
committed by
Paul O’Shannessy
parent
3ea3274ca4
commit
5ede7fb619
@@ -206,6 +206,15 @@ ReactDOMComponent.Mixin = {
|
||||
},
|
||||
|
||||
receiveComponent: function(nextComponent, transaction) {
|
||||
if (nextComponent === this) {
|
||||
// Since props and context are immutable after the component is
|
||||
// mounted, we can do a cheap identity compare here to determine
|
||||
// if this is a superfluous reconcile.
|
||||
|
||||
// TODO: compare the descriptor
|
||||
return;
|
||||
}
|
||||
|
||||
assertValidProps(nextComponent.props);
|
||||
ReactComponent.Mixin.receiveComponent.call(
|
||||
this,
|
||||
|
||||
Reference in New Issue
Block a user