sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

[ReactNativation] [ExpoRouter] Name navigation spans using dispatched action data

Open krystofwoldrich opened this issue 1 year ago • 2 comments

The ReactNavigationIntegration doesn't read dispatch action data and starts generic Route Changed navigation span on every dispatch.

Depending on the action type the new route name can be specified in the data. For example navigation action has name of the new route in it's payload. This might not be the final route as that depends on the router processing the action.

Using the data from the dispatched action will reduce the number of Route Changed spans. We should still update the name once the router processed the action with the final route name.


current integration implementation react-navigation onDispatch implementation poc branch


Related Issue: not all actions are expected to trigger navigation

krystofwoldrich avatar Jan 09 '25 10:01 krystofwoldrich

We need to ensure adding this doesn't break support for ReactNavigation V5 and V6.

krystofwoldrich avatar Jan 10 '25 14:01 krystofwoldrich

If there is no known name of the new route, the transaction should not be created. These data would be no use (just noise).

krystofwoldrich avatar Jun 10 '25 12:06 krystofwoldrich