Repository navigation
Conversation
Replace the placeholder in the CHANGELOG entry with the PR number, #6923.
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Expo Router 58 removed the internal router-store module and no longer emits React Navigation's __unsafe_action__ event. Because 58 declares package exports, Metro printed an invalid package.json warning for the router-store require on every bundle, and the integration could not start navigation spans. The navigation container ref now comes from the public useNavigationContainerRef export, which returns a module-level ref in Expo Router 57 and 58. Route info is computed from the root navigation state with getRouteInfoFromState, which both versions ship at the same path. On Expo Router 58 the integration listens to the internal actionDispatched event and starts the idle navigation span through a new internal _startIdleNavigationSpan method on reactNavigationIntegration. Expo Router 57 has no exports field, so the missing internalNavigationEvents path is a silent optional dependency there and spans still start from __unsafe_action__. Fixes #6901
Replace the placeholder in the CHANGELOG entry with the PR number, #6923.
87f19fa to
c899efa
Compare
87f19fa to
c899efa
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fc6a0b5. Configure here.
| stack: undefined, | ||
| }, | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Late navigation spans get discarded
High Severity
actionDispatched on Expo Router 58 fires after the new screen renders, but _startIdleNavigationSpan still waits for a later state event to attach route info. That event has typically already been delivered, so the idle span hits routeChangeTimeoutMs and is discarded instead of being sent.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit fc6a0b5. Configure here.


📢 Type of change
📜 Description
expoRouterIntegrationnow gets the navigation container ref from the publicuseNavigationContainerRefexport. It computes route info withgetRouteInfoFromState, which Expo Router 57 and 58 both have at the same path. On Expo Router 58, the integration listens to the internalactionDispatchedevent and starts navigation spans through a new internal_startIdleNavigationSpanmethod onreactNavigationIntegration.💡 Motivation and Context
Expo Router 58 removed
expo-router/build/global-state/router-storeand stopped sending__unsafe_action__. Metro then warned on every bundle, and the integration could not start navigation spans. Fixes #6901.💚 How did you test it?
I ran
expo exportonsamples/expo(expo-router58.0.23). The warning appeared 10 times before this change and 0 times after it. I added unit tests for the new route info source, the action listener, and the listener cleanup.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
On Expo Router 58,
actionDispatchedfires after the new screen renders, so spans start a bit late. A follow-up can use theexpo-router:action-enqueuedperformance mark for an earlier start time.