react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

SafeAreaView seems to fail on Expo when new arch is enabled

Open chriszs opened this issue 1 year ago • 8 comments

Repro: https://github.com/chriszs/test-expo-app/pull/4

Before enabling new arch:

Screenshot 2024-05-14 at 4 17 36 PM

After:

Screenshot 2024-05-14 at 4 10 43 PM

This is with 4.10.1.

chriszs avatar May 14 '24 08:05 chriszs

Try to adjust edges

artur-burlak avatar May 22 '24 10:05 artur-burlak

Did you put in a SafeAreaProvider at the top level?

jacobp100 avatar May 22 '24 10:05 jacobp100

Issue persists when I add SafeAreaProvider at top level.

chriszs avatar May 22 '24 16:05 chriszs

Here's the view hierarchy and a description of the safe area view/the child view, if that helps any:

Screenshot 2024-05-23 at 12 58 25 AM

(The duplicate provider view is because I believe Expo Router creates one as well.)

chriszs avatar May 22 '24 16:05 chriszs

You need to put a safe area provider inside each screen (RNSScreen)

jacobp100 avatar May 22 '24 17:05 jacobp100

Confirming the issue persists. Adding a new provider to each screen does not help either. Proper edges are included.

RohovDmytro avatar May 24 '24 15:05 RohovDmytro

I think we still have a few bugs with the new arch. I’m not sure any of the maintainers are using the new arch. If you’d like to take a stab at it we’d happily review and merge PRs. Otherwise I’d recommend holding off upgrading to the new arch

jacobp100 avatar May 24 '24 17:05 jacobp100

I'm using New Arch and it's working fine there

artur-burlak avatar May 26 '24 16:05 artur-burlak

Failing for me too on a simple swap to new arch. Not entirely sure where to look for the problem just yet given that it theoretically works for some.

djMax avatar Jun 07 '24 21:06 djMax

My App works fine, but after upgrading to expo 51 and turning on the "New Architecture" SafeAeriaView stops working for me too. I have it imported from 'react-native-safe-area-context', but know its other imports. Anyone have tested another import that works?

adrihegg avatar Jun 18 '24 13:06 adrihegg

Likely fixed in ce8aa20a5206da0520f20847f162653f8d6eb23e, but I haven't had a chance to verify yet.

chriszs avatar Jun 18 '24 14:06 chriszs

Yeah, looks like my reproduction no longer fails as of 4.10.5. Closing.

chriszs avatar Jun 18 '24 14:06 chriszs

Yes it is working fine in 4.10.7 I had this problem in 4.10.1

martinezguillaume avatar Jul 02 '24 14:07 martinezguillaume

I found same problem. SafeAreaView is not working in new architecture here is what I do:

Screenshot 2024-09-28 at 12 18 39 PM

usage :

Screenshot 2024-09-28 at 12 20 23 PM

ghulamhussainjoyo avatar Sep 28 '24 07:09 ghulamhussainjoyo

please guys remember to rebuild after upgrading to new versions.

mo-fouad avatar Oct 01 '24 23:10 mo-fouad