Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/react
SDK Version
10.1.0
Framework Version
18.3.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
Hello! 👋
My application is using the following setup with Sentry's SDK and its integration with React Router
import { createHashRouter } from 'react-router-dom'; // @v6.29.0
...
// https://docs.sentry.io/platforms/javascript/guides/react/features/react-router/#usage-with-react-router-64-data-api
const sentryCreateHashRouter = Sentry.wrapCreateBrowserRouterV6(createHashRouter);
const router = sentryCreateHashRouter(
[
{
path: ALBUM.path,
element: <AlbumView />,
}
...
],
{
basename: '/',
future: {
v7_relativeSplatPath: true,
v7_startTransition: true,
},
});
Steps to Reproduce
- I updated the route to use a feature from React router called data loaders (read more) with the following code
{
path: ALBUM.path,
element: <AlbumView />,
+ loader: () =>
+ Promise.resolve({
+ album: {
+ id: '123',
+ name: 'Album Name',
+ artist: 'Artist Name',
+ },
+ }),
},
- Then I measured the performance using DevTools
Expected Result
Since the data loader is not doing much, I was expecting the performance overhead to be mininum
Actual Result
I noticed a 10x increased in the flamewar for the function startBrowserTracingNavigationSpan
Before:

After:

This overhead goes away after I remove the wrapper Sentry.wrapCreateBrowserRouterV6. There is a difference between using and not using data loaders but it's minimum.
Thanks in advance for looking into this.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/react
SDK Version
10.1.0
Framework Version
18.3.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
Hello! 👋
My application is using the following setup with Sentry's SDK and its integration with React Router
Steps to Reproduce
{ path: ALBUM.path, element: <AlbumView />, + loader: () => + Promise.resolve({ + album: { + id: '123', + name: 'Album Name', + artist: 'Artist Name', + }, + }), },Expected Result
Since the data loader is not doing much, I was expecting the performance overhead to be mininum
Actual Result
I noticed a 10x increased in the flamewar for the function
startBrowserTracingNavigationSpanBefore:

After:

This overhead goes away after I remove the wrapper
Sentry.wrapCreateBrowserRouterV6. There is a difference between using and not using data loaders but it's minimum.Thanks in advance for looking into this.