MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getActiveRootSpan

Function getActiveRootSpan

packages/react/src/reactrouter.tsx:255–267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */
254
255function getActiveRootSpan(): Span | undefined {
256 const span = getActiveSpan();
257 const rootSpan = span && getRootSpan(span);
258
259 if (!rootSpan) {
260 return undefined;
261 }
262
263 const op = spanToJSON(rootSpan).op;
264
265 // Only use this root span if it is a pageload or navigation span
266 return op === 'navigation' || op === 'pageload' ? rootSpan : undefined;
267}

Callers 1

WrappedRouteFunction · 0.70

Calls 3

getActiveSpanFunction · 0.90
spanToJSONFunction · 0.90
getRootSpanFunction · 0.85

Tested by

no test coverage detected