mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 01:40:08 +00:00
Update hook event names
Summary: This brings RN up to date with https://github.com/facebook/react/pull/7472 (scheduled for React 15.3.1). If you use React 15.3.1 with RN without this patch, Systrace output will lack the reconciler events. (Since it’s a niche feature it didn’t seem to me that full backward compat is necessary so I just removed old hooks. This won’t cause crashes—it’s just you won’t get events in Systrace if you use new React but old RN.) Closes https://github.com/facebook/react-native/pull/9383 Differential Revision: D3738463 Pulled By: spicyj fbshipit-source-id: 791cdbc5558666a101fa403f4e7852f700038fc9
This commit is contained in:
parent
aacfc372c9
commit
1aef7e4629
@ -31,11 +31,25 @@ let _enabled = false;
|
||||
let _asyncCookie = 0;
|
||||
|
||||
const ReactSystraceDevtool = __DEV__ ? {
|
||||
onBeginReconcilerTimer(debugID, timerType) {
|
||||
onBeforeMountComponent(debugID) {
|
||||
const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID);
|
||||
Systrace.beginEvent(`ReactReconciler.${timerType}(${displayName})`);
|
||||
Systrace.beginEvent(`ReactReconciler.mountComponent(${displayName})`);
|
||||
},
|
||||
onEndReconcilerTimer(debugID, timerType) {
|
||||
onMountComponent(debugID) {
|
||||
Systrace.endEvent();
|
||||
},
|
||||
onBeforeUpdateComponent(debugID) {
|
||||
const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID);
|
||||
Systrace.beginEvent(`ReactReconciler.updateComponent(${displayName})`);
|
||||
},
|
||||
onUpdateComponent(debugID) {
|
||||
Systrace.endEvent();
|
||||
},
|
||||
onBeforeUnmountComponent(debugID) {
|
||||
const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID);
|
||||
Systrace.beginEvent(`ReactReconciler.unmountComponent(${displayName})`);
|
||||
},
|
||||
onUnmountComponent(debugID) {
|
||||
Systrace.endEvent();
|
||||
},
|
||||
onBeginLifeCycleTimer(debugID, timerType) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user