109
currentFlushMeasurements = [];
110
}
111
112
-function checkDebugID(debugID) {
112
+function checkDebugID(debugID, allowRoot = false) {
113
+ if (allowRoot && debugID === 0) {
114
+ return;
115
+ }
116
if (!debugID) {
117
warning(false, 'ReactDebugTool: debugID may not be empty.');
118
}
251
endLifeCycleTimer(debugID, timerType);
252
emitEvent('onEndLifeCycleTimer', debugID, timerType);
253
},
251
- onBeginReconcilerTimer(debugID, timerType) {
252
- checkDebugID(debugID);
253
- emitEvent('onBeginReconcilerTimer', debugID, timerType);
254
- },
255
- onEndReconcilerTimer(debugID, timerType) {
256
- checkDebugID(debugID);
257
- emitEvent('onEndReconcilerTimer', debugID, timerType);
258
- },
254
onError(debugID) {
255
if (currentTimerDebugID != null) {
256
endLifeCycleTimer(currentTimerDebugID, currentTimerType);
267
checkDebugID(debugID);
268
emitEvent('onHostOperation', debugID, type, payload);
269
},
275
- onComponentHasMounted(debugID) {
276
- checkDebugID(debugID);
277
- emitEvent('onComponentHasMounted', debugID);
278
- },
279
- onComponentHasUpdated(debugID) {
280
- checkDebugID(debugID);
281
- emitEvent('onComponentHasUpdated', debugID);
282
- },
270
onSetState() {
271
emitEvent('onSetState');
272
},
275
childDebugIDs.forEach(checkDebugID);
276
emitEvent('onSetChildren', debugID, childDebugIDs);
277
},
291
- onSetParent(debugID, parentDebugID) {
292
- checkDebugID(debugID);
293
- emitEvent('onSetParent', debugID, parentDebugID);
294
- },
295
- onInstantiateComponent(debugID, element) {
296
- checkDebugID(debugID);
297
- emitEvent('onInstantiateComponent', debugID, element);
298
- },
299
- onMountRootComponent(debugID) {
278
+ onBeforeMountComponent(debugID, element, parentDebugID) {
279
checkDebugID(debugID);
301
- emitEvent('onMountRootComponent', debugID);
302
- },
303
- onBeforeMountComponent(debugID, element) {
304
- checkDebugID(debugID);
305
- emitEvent('onBeforeMountComponent', debugID, element);
280
+ checkDebugID(parentDebugID, true);
281
+ emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
282
},
283
onMountComponent(debugID) {
284
checkDebugID(debugID);
292
checkDebugID(debugID);
293
emitEvent('onUpdateComponent', debugID);
294
},
295
+ onBeforeUnmountComponent(debugID) {
296
+ checkDebugID(debugID);
297
+ emitEvent('onBeforeUnmountComponent', debugID);
298
+ },
299
onUnmountComponent(debugID) {
300
checkDebugID(debugID);
301
emitEvent('onUnmountComponent', debugID);