Skip to content

Correct route and dynamic param extraction for Expo Router #6157

Closed

Description

@alwx

extractDynamicRouteParams() works but:

  • Transaction names are noisy/uninformative (index, (tabs)).
  • Dynamic param extraction almost never finds matching keys, so spans rarely carry route.params.* attributes.
  • useFullPathsForNavigationRoutes builds a path from nested navigators, but it joins React Navigation names, not Expo Router pathnames.

Here is what we can do: When Expo Router is active, derive the route from Expo Router's own state rather than from getCurrentRoute().name:

  • Use the Expo Router path (e.g. /profile/[id]) as the canonical span name and route.name attribute.
  • Extract dynamic params from the matched route pattern + the actual params object, including catch-all [...slug].
  • Keep query-string params off the span by default; gate them behind sendDefaultPii (matching the existing PII model in deeplink.ts and the current extractDynamicRouteParams contract).
  • Set route.path (templated) and, under sendDefaultPii, route.url (concrete).

Activity

  1. linear-code commented on May 18, 2026

    @linear-code
  2. self-assigned this
    on May 18, 2026
  3. github-actions commented on May 28, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6197, which was included in the 8.13.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions