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

Fix no rendered content on CarPlay

Open tommynordli opened this issue 1 year ago • 4 comments

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

tommynordli avatar Feb 28 '24 13:02 tommynordli

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

jacobp100 avatar Feb 28 '24 13:02 jacobp100

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.

tommynordli avatar Feb 28 '24 13:02 tommynordli

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

jacobp100 avatar Feb 28 '24 14:02 jacobp100

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.

janicduplessis avatar Feb 28 '24 15:02 janicduplessis