mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Repair ReactDefaultPerf
Update ReactDefaultPerf to properly record component names.
This commit is contained in:
@@ -242,10 +242,18 @@ var ReactDefaultPerf = {
|
||||
addValue(entry.inclusive, rootNodeID, totalTime);
|
||||
}
|
||||
|
||||
var displayName = null;
|
||||
if (this._instance.constructor.displayName) {
|
||||
displayName = this._instance.constructor.displayName;
|
||||
} else if (this._currentElement.type) {
|
||||
displayName = this._currentElement.type;
|
||||
}
|
||||
|
||||
entry.displayNames[rootNodeID] = {
|
||||
current: this.constructor.displayName,
|
||||
current: displayName,
|
||||
owner: this._currentElement._owner ?
|
||||
this._currentElement._owner.constructor.displayName : '<root>'
|
||||
this._currentElement._owner._instance.constructor.displayName :
|
||||
'<root>'
|
||||
};
|
||||
|
||||
return rv;
|
||||
|
||||
Reference in New Issue
Block a user