[iOS][v6] SafeAreaView not working when inside a stack on the center of a sideMenu layout
Issue Description
On iOS: The SafeAreaView component from React Native doesn't work when the screen is inside a stack on the center of a sideMenu layout. So the content of the screen goes under the status bar and that's not the desired behavior in my app.
In may case, this is the only situation where it doesn't work.
Steps to Reproduce / Code Snippets / Screenshots
This is the simplified code that i'm using on my app:
Navigation.setRoot({
root: {
bottomTabs: {
children: [
{ // --- Tab 1 --- //
stack: {
children: [
{
component: {
name: 'Home',
},
},
//...
],
options: {
//...
},
},
},
{ // --- Tab 2 --- //
sideMenu: {
center: {
stack: {
children: [
{
component: {
name: 'Search',
},
},
//...
],
},
},
right: {
component: {
id: 'SideDrawerOne',
name: 'SideDrawerOne',
},
enabled: true,
},
options: {
//...
},
},
},
{ // --- Tab 3 --- //
sideMenu: {
left: {
component: {
id: 'SideDrawerTwo',
name: 'SideDrawerTwo',
},
enabled: true,
},
center: {
stack: {
children: [
{
component: {
id: 'UserProfile',
name: 'UserProfile',
},
//...
},
],
},
},
options: {
//...
},
},
},
],
options: {
//...
},
},
},
});
All the screens have React Native's SafeAreaView component inside them (Home,Search, SideDrawerOne, SideDrawerTwo and UserProfile).
It works WELL on Home, on SideDrawerOne and on SideDrawerTwo BUT NOT on Search and UserProfile.
If I don't use stack and change them to a simple component layout, it works well. Example:
center: {
component: {
id: 'UserProfile',
name: 'UserProfile',
},
},
But I need them to be a stack.
I found a solution but...
I think is not the best as it involves the use of another navigation library. Basically, instead of using React Native's component, use the one from react-navigation v4.
import { SafeAreaView } from 'react-navigation';
So, although my problem is fixed, I consider important to report the bug to you so you can fix it on your library in a future release.
PS: I also tried react-native-safe-area-view but couldn't get it to work.
Environment
- React Native Navigation version: 6.1.0
- React Native version: 0.61.5
- Platform(s) (iOS, Android, or both?): iOS
- Device info (Simulator/Device? OS version? Debug/Release?): iOS 13 and iOS 12 both simulator (iPhone 11, iPhone X) and device (iPhone 6s Plus, iPhone 6s Plus). Both debug and release.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.
The issue has been closed for inactivity.