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

SafeAreaProvider interfering with native performance measure on Android

未關閉
#630 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
2.8k
分支
258
平均合併
3 天 1 小時
30 天內合併 PR
2

描述

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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。