From dfebcb70a5c948db94d1cd580bbcaa0aaa702349 Mon Sep 17 00:00:00 2001 From: Alexey Lang Date: Fri, 1 Dec 2017 02:37:06 -0800 Subject: [PATCH] Don't set global.performance to undefined if it was initialized already Reviewed By: gaearon Differential Revision: D6448731 fbshipit-source-id: 8c8c6ff393e452c863f54c83c2e4394fd535dfc5 --- Libraries/Performance/Systrace.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/Performance/Systrace.js b/Libraries/Performance/Systrace.js index d9a8908f9..6e09bc6cf 100644 --- a/Libraries/Performance/Systrace.js +++ b/Libraries/Performance/Systrace.js @@ -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) {