mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Short-circuit updatePropertyByID
When `ReactNativeComponent` updates, it calls `updatePropertyByID` in `ReactDOMIDOperations` which calls `DOMPropertyOperations`. However, in `ReactDOMIDOperations`, we will lookup the node for an ID using `ReactID.getNode`. This wastes time looking for nodes when we may not need to ever update it (e.g. `children`). This changes `ReactNativeComponent` to bail out sooner.
This commit is contained in:
committed by
Paul O’Shannessy
parent
92dab0759c
commit
7b68fcd408
@@ -20,6 +20,7 @@
|
||||
"use strict";
|
||||
|
||||
var CSSPropertyOperations = require('CSSPropertyOperations');
|
||||
var DOMProperty = require('DOMProperty');
|
||||
var DOMPropertyOperations = require('DOMPropertyOperations');
|
||||
var ReactComponent = require('ReactComponent');
|
||||
var ReactEventEmitter = require('ReactEventEmitter');
|
||||
@@ -277,7 +278,9 @@ ReactNativeComponent.Mixin = {
|
||||
}
|
||||
} else if (registrationNames[propKey]) {
|
||||
putListener(this._rootNodeID, propKey, nextProp);
|
||||
} else {
|
||||
} else if (
|
||||
DOMProperty.isStandardName[propKey] ||
|
||||
DOMProperty.isCustomAttribute(propKey)) {
|
||||
ReactComponent.DOMIDOperations.updatePropertyByID(
|
||||
this._rootNodeID,
|
||||
propKey,
|
||||
|
||||
Reference in New Issue
Block a user