th3rdwave / react-native-safe-area-context

A flexible way to handle safe area insets in JS. Also works on Android and Web!
MIT License
2.14k stars 197 forks source link

SafeAreaView seems to fail on Expo when new arch is enabled #496

Closed chriszs closed 3 months ago

chriszs commented 4 months ago

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.

artur-burlak commented 4 months ago

Try to adjust edges

jacobp100 commented 4 months ago

Did you put in a SafeAreaProvider at the top level?

chriszs commented 4 months ago

Issue persists when I add SafeAreaProvider at top level.

chriszs commented 4 months ago

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.)

jacobp100 commented 4 months ago

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

RohovDmytro commented 4 months ago

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

jacobp100 commented 4 months ago

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

artur-burlak commented 4 months ago

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

djMax commented 3 months ago

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.

adrihegg commented 3 months ago

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?

chriszs commented 3 months ago

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

chriszs commented 3 months ago

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

martinezguillaume commented 3 months ago

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

ghulamhussainjoyo commented 4 days ago

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
mo-fouad commented 21 hours ago

please guys remember to rebuild after upgrading to new versions.