Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SafeAreaProvider doesn't render content if the app is launched from CarPlay #135

Open
gaodeng opened this issue Aug 1, 2020 · 3 comments · May be fixed by #474
Open

SafeAreaProvider doesn't render content if the app is launched from CarPlay #135

gaodeng opened this issue Aug 1, 2020 · 3 comments · May be fixed by #474
Labels
bug Something isn't working help wanted Extra attention is needed Platform: iOS

Comments

@gaodeng
Copy link

gaodeng commented Aug 1, 2020

If the app is launched from carplay, the insets here will be null which cause SafeAreaProvider doesn't render content

@janicduplessis
Copy link
Member

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.

@janicduplessis janicduplessis added help wanted Extra attention is needed need more info bug Something isn't working and removed need more info labels Aug 19, 2020
@jacobp100
Copy link
Collaborator

@gaodeng I'd be happy to look at PRs

@jacobp100 jacobp100 reopened this Jan 19, 2023
@tommynordli tommynordli linked a pull request Feb 28, 2024 that will close this issue
@tommynordli
Copy link

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>
   );
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed Platform: iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants