@shopify/performance
Advanced tools
Comparing version
@@ -72,3 +72,11 @@ 'use strict'; | ||
history.replaceState = (...args) => { | ||
handlePushOrReplace(args[2]); | ||
var _history$state, _args$; | ||
// React Router v6 introduced special behaviour that replaces state on initialization | ||
// It does this only when the current idx state is null, and it sets it to 0 | ||
// We need to account for this to prevent it from being recorded as a navigation | ||
if (!(((_history$state = history.state) === null || _history$state === void 0 ? void 0 : _history$state.idx) == null && ((_args$ = args[0]) === null || _args$ === void 0 ? void 0 : _args$.idx) === 0)) { | ||
handlePushOrReplace(args[2]); | ||
} | ||
replaceState.call(history, ...args); | ||
@@ -75,0 +83,0 @@ }; |
{ | ||
"name": "@shopify/performance", | ||
"version": "3.2.4", | ||
"version": "3.2.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Primitives for collecting browser performance metrics", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
87325
1.77%1457
0.83%