Skip to content

Commit dcfe90c

Browse files
committed
fix(core): Gate dispatched route name extraction behind useDispatchedActionData
Ensure getRouteNameFromAction is only called when useDispatchedActionData is enabled. Previously, the route name was extracted from the action payload even when the feature was disabled, which could change the span name and beforeStartSpan input for users who hadn't opted in.
1 parent 3ca05a5 commit dcfe90c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/core/src/js/tracing/reactnavigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export const reactNavigationIntegration = ({
378378
}
379379

380380
// Extract route name from dispatch action payload when available
381-
const dispatchedRouteName = getRouteNameFromAction(event);
381+
const dispatchedRouteName = useDispatchedActionData ? getRouteNameFromAction(event) : undefined;
382382
if (useDispatchedActionData && !dispatchedRouteName && !isAppRestart) {
383383
debug.log(`${INTEGRATION_NAME} Navigation action has no route name in payload, not starting navigation span.`);
384384
return;

0 commit comments

Comments
 (0)