Skip to content

Commit dfebcb7

Browse files
alexeylangfacebook-github-bot
authored andcommitted
Don't set global.performance to undefined if it was initialized already
Reviewed By: gaearon Differential Revision: D6448731 fbshipit-source-id: 8c8c6ff393e452c863f54c83c2e4394fd535dfc5
1 parent 4fdaf2d commit dfebcb7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Libraries/Performance/Systrace.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ const Systrace = {
161161
}
162162
if (_canInstallReactHook) {
163163
if (_useFiber) {
164-
global.performance = enabled ? userTimingPolyfill : undefined;
164+
if (enabled && global.performance === undefined) {
165+
global.performance = userTimingPolyfill;
166+
}
165167
} else {
166168
const ReactDebugTool = require('ReactDebugTool');
167169
if (enabled) {

0 commit comments

Comments
 (0)