Skip to content

Commit

Permalink
Don't overwrite onreadystatechange in resource logger (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador authored Jul 11, 2023
1 parent 1f422a2 commit 75b9a8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-native-performance/src/resource-logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const installResourceLogger = (
super(...args);
this.performanceStartTime = null;

super.onreadystatechange = () => {
super.addEventListener('readystatechange', () => {
if (this.readyState === this.DONE) {
if (this.responseURL && this.responseHeaders) {
const responseEnd = performance.now();
Expand All @@ -43,7 +43,7 @@ export const installResourceLogger = (
);
}
}
};
});
}

open(...args: any) {
Expand Down

0 comments on commit 75b9a8c

Please sign in to comment.