appandflow / appandflow/react-native-safe-area-context
SafeAreaProvider interfering with native performance measure on Android
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.8k
- Forks
- 258
- Ø Merge
- 3 T. 1 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
### Description
Hello, I've been struggling with this issue on Android, but not on iOS.
I'm trying to use `react-native-performance` to measure the starting time of my app. I'm able to access native start times in my app but as soon as the measurement is triggered from a component contained by `SafeAreaProvider`, I no longer receive any measurements.
I was able to create a minimal reproducible example here:
https://github.com/cgerrard-pass/PerfMRE
What I did in the example above is simply:
- create a react native project with 0.73.11
- create a hook that measures performance
- wrap my app in `SafeAreaProvider`
- see empty logs
If I remove `SafeAreaProvider` from `App.tsx`, the logs contain the measurements and are no longer empty.
```sh
# with SafeAreaProvider
LOG Running "PerfMRE" with {"rootTag":31}
LOG []
LOG []
LOG []
LOG []
# without SafeAreaProvider
LOG Running "PerfMRE" with {"rootTag":31}
LOG []
LOG [
{
"name": "nativeLaunchEnd",
"entryType": "react-native-mark",
"startTime": 21650442,
"duration": 0
}
]
```
I've created another issue on `react-native-performance` but I haven't received any answers.
https://github.com/oblador/react-native-performance/issues/112
I can bump `react-native-safe-area-context` to a more recent version (but before v5) but I don't think it will change anything since I attempted doing that on my other project I'm running into issues with.
Any help would be appreciated! Thank you
### Steps to reproduce
create a react native project with 0.73.11
create a hook that measures performance
wrap my app in SafeAreaProvider
see empty logs
### Snack or a link to a repository
https://github.com/cgerrard-pass/PerfMRE
### Safe Area Context version
3.4.1
### React Native version
0.73.11
### Platforms
Android
### Architecture
None
### Build type
Debug mode
### Device
Android emulator
### Device model
_No response_
### Acknowledgements
Yes
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.