remove navigation header react native code example
Example 1: how to remove name in react navigation header
<Stack.Navigator
screenOptions={{
headerShown: false
}}
>
<Stack.Screen name="route-name" component={ScreenComponent} />
</Stack.Navigator>
Example 2: how to hide header in react navigation
<Stack.Navigator
screenOptions={{
headerShown: false
}}
>
<Stack.Screen name="route-name" component={ScreenComponent} />
</Stack.Navigator>
Example 3: react native navigation remove top header screen
export default class Login extends Component {
static navigationOptions = {
header: null
}
}
setTimeout(() => {
navigation.setOptions({
header: () => (
<View style={{ backgroundColor: "white" }}>
<Text
style={[
{ color: "white" },
Platform.OS === "android" ? { fontSize: 20 } : { fontSize: 1 }
]}
>
.
</Text>
</View>
)
});
}, 1);