Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: remove top margin from screen in native stack on Android
Browse files Browse the repository at this point in the history
In newer versions of react-native-screens, the content is no longer below the header, so the top margin in not needed anymore.
  • Loading branch information
satya164 committed Nov 2, 2019
1 parent c55d451 commit 5cd6940
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions packages/native-stack/src/views/StackView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { View, StyleSheet, Platform } from 'react-native';
import { View, StyleSheet } from 'react-native';
import { StackNavigationState, StackActions } from '@react-navigation/routers';

import {
Expand Down Expand Up @@ -43,20 +43,7 @@ export default function StackView({ state, navigation, descriptors }: Props) {
}}
>
<HeaderConfig {...options} route={route} />
<View
style={[
styles.content,
{
marginTop:
Platform.OS === 'android' && options.headerShown !== false
? 56
: 0,
},
contentStyle,
]}
>
{renderScene()}
</View>
<View style={[styles.content, contentStyle]}>{renderScene()}</View>
</Screen>
);
})}
Expand Down

0 comments on commit 5cd6940

Please sign in to comment.