fix: React Navigation Instrumentation starts initial transaction before navigator mount #1315
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
On V5, the initial blank transaction is now set on the routing instrumentation register instead of the navigator mount, this way it gets set on the scope before the app component is mounted. Then, once the navigator is mounted,
beforeNavigate
is called, and the transaction on the scope is updated with the new context.On V4, the same strategy is adopted as V5. This means that now V4 has the option of updating a transaction on the scope instead of just setting a new one. For V4 however, this behavior is only used on the initial transaction and nothing is changed by this PR for subsequent route changes.
💡 Motivation and Context
Fixes #1314
💚 How did you test it?
Updated V4 tests to account for these changes. Ran V5 on simulator, needs testing for V4.
📝 Checklist