Я пытаюсь добавить кнопку назад в свое приложение, но у меня возникли некоторые проблемы. Кнопка, кажется, не рендерится в заголовке. Будем благодарны за любые предложения или предложения.
![This is what it looks like in the ios Simulator.](https://i.stack.imgur.com/HfHuG.png)
if (!isLoadingComplete && !props.skipLoadingScreen) {
return null;
} else {
return (
<View style={styles.container}>
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
<NavigationContainer ref={containerRef} initialState={initialNavigationState}>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={HamburgerMenu}
options={{
headerLeft:()=>{
<Button
title = "Back"
onPress={(Back)=>{ Back.goBack(); }} />
},
headerStyle: {
backgroundColor: '#bb1111',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
</Stack.Navigator>
</NavigationContainer>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
});
Это мой код для приложения. js.