Skip to content

@datadog/browser-rum-react and @react-router/dev/routes integration for react-router v7 #3435

Open
@jdnichollsc

Description

@jdnichollsc

What are you trying to achieve and what is your issue? Please describe.
We are working on a SSR FrontEnd project using React Router v7 (Framework mode) with route definitions being handled via @react-router/dev/routes (see below screenshot).

screenshot of routes

We are currently integrating @datadog/browser-rum-react for tracking route changes and user interactions. However, we are unsure how to properly integrate Datadog’s RUM routing instrumentation with this setup since routes are defined programmatically using layout(), index(), and route() helpers.

There’s limited guidance on how datadogRum’s routing instrumentation (e.g., datadogRum.startView()) should be integrated in this dynamic routing setup.

Describe the solution you'd like
We would like a recommended approach for connecting Datadog’s RUM SDK with this kind of route configuration. Specifically:
• How should we hook into route changes when using @react-router/dev/routes?
• What is the suggested way to automatically track navigation and page views when routes are defined in this centralized config file?

Describe alternatives you've considered
Using @datadog/browser-rum package directly for now.

Thanks folks for your support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions