Reactotron: NativePerformance.now is undefined

Created on 4 Sep 2017  路  3Comments  路  Source: infinitered/reactotron

screen shot 2017-09-04 at 12 20 53 pm

React Native 0.47. Wonder if I'm missing a polyfill for window.performance? I can fix manually by wrapping the function in a typeof. Happy to submit a PR

// try to find the browser-based performance timer
var nativePerformance = typeof window !== 'undefined' && window && (window.performance || window.msPerformance || window.webkitPerformance);

// if we do find it, let's setup to call it
var nativePerformanceNow = function nativePerformanceNow() {
+  if (typeof nativePerformance.now === "function") {
    return nativePerformance.now();
+ } else {
+   return Date.now();
+ }
};

Most helpful comment

Ah yep, thought my constraint was latest 1.12 but it was locked to prior to 2823863103ea4bef677c14183aa829f8d4cf714e

All 3 comments

What version of Reactotron are you running?

Ah yep, thought my constraint was latest 1.12 but it was locked to prior to 2823863103ea4bef677c14183aa829f8d4cf714e

Glad that was an easy one to fix up

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kida007 picture Kida007  路  4Comments

andrewvy picture andrewvy  路  4Comments

Eyesonly88 picture Eyesonly88  路  4Comments

itaied246 picture itaied246  路  4Comments

lndgalante picture lndgalante  路  4Comments