Skip to content

Commit

Permalink
Don't set global.performance to undefined if it was initialized already
Browse files Browse the repository at this point in the history
Reviewed By: gaearon

Differential Revision: D6448731

fbshipit-source-id: 8c8c6ff393e452c863f54c83c2e4394fd535dfc5
  • Loading branch information
alexeylang authored and facebook-github-bot committed Dec 1, 2017
1 parent 4fdaf2d commit dfebcb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Libraries/Performance/Systrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ const Systrace = {
}
if (_canInstallReactHook) {
if (_useFiber) {
global.performance = enabled ? userTimingPolyfill : undefined;
if (enabled && global.performance === undefined) {
global.performance = userTimingPolyfill;
}
} else {
const ReactDebugTool = require('ReactDebugTool');
if (enabled) {
Expand Down

0 comments on commit dfebcb7

Please sign in to comment.