react-native-safe-area-context
react-native-safe-area-context copied to clipboard
SafeAreaProvider doesn't render content if the app is launched from CarPlay
If the app is launched from carplay, the insets here will be null which cause SafeAreaProvider doesn't render content https://github.com/th3rdwave/react-native-safe-area-context/blob/b1824ef84d78a44e91cd156a29abe3da243eee94/src/SafeAreaContext.tsx#L78
Interesting, I'm not familiar with carplay, I assume it doesn't trigger the same layout events as android which means JS never receive inset values.
@gaodeng I'd be happy to look at PRs
Simply returning the children instead of null fixed it for me. Submitted a PR
diff --git a/node_modules/react-native-safe-area-context/src/SafeAreaContext.tsx b/node_modules/react-native-safe-area-context/src/SafeAreaContext.tsx
index 5da007e..6a29480 100644
--- a/node_modules/react-native-safe-area-context/src/SafeAreaContext.tsx
+++ b/node_modules/react-native-safe-area-context/src/SafeAreaContext.tsx
@@ -100,7 +100,7 @@ export function SafeAreaProvider({
{children}
</SafeAreaInsetsContext.Provider>
</SafeAreaFrameContext.Provider>
- ) : null}
+ ) : children}
</NativeSafeAreaProvider>
);
}