react-native-unistyles: Incorrect bottom inset (Android)

Description

Unistyles runtime incorrectly reports insets.bottom as 0. insets.top appears to work corrrectly. This occurs both when calling the runtime directly and when calling the createStyleSheet runtime param

Steps to reproduce

  1. Use Android device with bottom safe area (e.g. Pixel 7 Pro)
  2. Compare useSafeAreaInsets() to UnistylesRuntime.insets

Snack or a link to a repository (optional)

https://snack.expo.dev/@haydenbriese/graceful-blue-sandwich

Unistyles version

2.7.1

React Native version

0.73.6

Platforms

Android

Engine

Hermes

Architecture

Paper (old)

About this issue

  • Original URL
  • State: closed
  • Created 2 months ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

Thanks guys, please stay at 2.7.1. I need to rethink expo status bar support

Thanks guys! I will check the repro and try to patch it ๐Ÿ˜‡

Hi, I noticed a regression on low-end Android device (Alcatel 1B with Android 10) in bare react-native.

const { bottom } = useSafeAreaInsets // 0 โœ… runtime.insets.bottom // 0 unistyles@2.7.1 โœ… runtime.insets.bottom // 48 unistyles@2.7.2 โญ•

All works! Thanks for the quick fix ๐Ÿ˜„

@jpudysz Thanks for creating such an amazing library!

Like the above comments have already mentioned, even weโ€™ve been seeing that bottom inset from UnistylesRuntime always returns 0. And we are not setting NavigationBar position to absolute. Interestingly, even useSafeAreaInsets returns bottom inset as 0. Not sure what weโ€™re missing though.

Tested Devices

  1. Pixel 6
  2. Redmi Note 9 Pro
  3. Samsung Galaxy S20 FE 5G

Unistyles Version 2.7.1

Platform Android