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

Fix no rendered content on CarPlay #474

Closed tommynordli closed 3 months ago

tommynordli commented 7 months ago

Summary

When having the app opened on CarPlay only, there are no safe area insets, resulting in the provider just returning null. Just returning the children instead does the trick. This should fix #135

jacobp100 commented 7 months ago

I don’t think this is the right fix. Why aren’t there insets?

tommynordli commented 7 months ago

I didn't spend too much time digging into it so I'm not sure exactly why, but I don't think safearea insets on CaPlay aren't really neccessary as it's mostly template based. This only happens when launching the app from CarPlay with the app closed on the device btw, not if the app is initialized on the phone first.

jacobp100 commented 7 months ago

We can't merge this change because it'll cause excessive renders. If you figure out why the insets aren't getting set, we can look at merging something that fixes that issue

janicduplessis commented 7 months ago

Yea, we need to keep the current behaviour of rendering null until we receive the first inset events. Is there a way to know it is carplay from JS? Or we could manually send an insets event with 0 insets if carplay from native code.

jacobp100 commented 3 months ago

Closing - if you find the root cause, feel free to ping me or open a new PR

mefjuu commented 3 months ago

@janicduplessis Have you managed to obtain the flag while JS bundle is running in carplay?

jacobp100 commented 3 months ago

@mefjuu nobody is working on this. Feel free to take it on if you wish