bugsnag / bugsnag-js-performance

Monitor the performance of your JavaScript (web and React Native) and see the results in your BugSnag dashboard.
https://docs.bugsnag.com/performance/integration-guides
MIT License
5 stars 3 forks source link

Fix crash when navigation ref is created with useRef #469

Closed yousif-bugsnag closed 3 months ago

yousif-bugsnag commented 3 months ago

Goal

Support navigation refs created using useRef.

Currently the React Navigation plugin expects the passed in navigation ref to be created with useNavigationContainerRef, and crashes if the ref was created with useRef, since in that case getCurrentRoute should be accessed via ref.current.

Design

the code now first checks if ref.current exists and then falls back to calling getCurrentRoute on the ref directly.

github-actions[bot] commented 3 months ago

Browser bundle size

NPM build

Package
Before 190.22 kB
After 190.22 kB
± No change

CDN build

Unminified Minfied Minified + gzipped
Before 95.42 kB 35.80 kB 10.84 kB
After 95.42 kB 35.80 kB 10.84 kB
± No change No change No change

Code coverage

Coverage values did not change👌.

Total:

Lines Branches Functions Statements
87.13%(+0%) 78.33%(+0%) 88.06%(+0%) 83.93%(+0%)

Generated against b04e6e1ab477f6536b21c642fbb49fa8ee5e85bc on 3 July 2024 at 08:35:11 UTC