Skip to content

SafeAreaProvider interfering with native performance measure on Android #630

@cgerrard-pass

Description

@cgerrard-pass

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.

# 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.
oblador/react-native-performance#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions