appandflow / appandflow/react-native-safe-area-context

SafeAreaProvider interfering with native performance measure on Android

Ouverte
#630 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
2.8k
Forks
258
Merge moyen
3 j 1 h
PR mergées (30 j)
2

Description

### 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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.