Skip to content

when using withSentryReactRouterV6Routing, component gets un-mounted and re-mounted instead of re-rendered #9228

@wlyu2001

Description

@wlyu2001

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

7.73

Framework Version

17.0.2

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

  1. Create SentryRoutes and use it to replace standard , for example:
const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes); 
...
return(
...
<SentryRoutes>
<Route path={URLPath.Home} element={<Home />} />
<Route path={URLPath.Notes} element={<Notes />} />
<Route path={URLPath.Notebooks} element={<Notebooks />} />
...
</SentryRoutes>
)
  1. Trigger state change inside Home component, it gets un-mounted and re-mounted.

Similar issue was reported here, but it was only for wrapUseRoutes.

Expected Result

The component should be re-rendered.

Actual Result

The component is un-mounted and re-mounted instead.

Metadata

Metadata

Assignees

Labels

Package: reactIssues related to the Sentry React SDK

Projects

Status

Waiting for: Community

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions