Allow empty components in the native operation logs
Fixes #6742
Dan Abramov committed
May 11, 2016 at 23:31 UTC
0cd1d3b5a252ec99b4452c0d3e91a952dea780ff
1 file changed
+7
-1
src/isomorphic/ReactPerf.js
+7
-1
@@ -236,11 +236,17 @@ function getWasted(flushHistory = getFlushHistory()) {
236
237
function getOperations(flushHistory = getFlushHistory()) {
238
var stats = [];
239
+
240
flushHistory.forEach((flush, flushIndex) => {
241
var {operations, treeSnapshot} = flush;
242
+
243
operations.forEach(operation => {
244
var {instanceID, type, payload} = operation;
243
- var {displayName, ownerID} = treeSnapshot[instanceID];
245
+ var {displayName, ownerID} = instanceID !== 0 ?
246
+ treeSnapshot[instanceID] :
247
+ // Empty components may appear in some operation logs.
248
+ {displayName: '#empty', ownerID: null};
249
+
250
var owner = treeSnapshot[ownerID];
251
var key = (owner ? owner.displayName + ' > ' : '') + displayName;
252