I am using the React native navigation v5 I create a header on separated file and that file use this in stack header
make a button for open drawer navigation
header file
OpenMenu=(navigation)=>{
navigation.openDrawer();
}
export default function Header({navigation,title}) {
return (
<View style={styles.container}>
<MaterialIcons name="menu" size={28} onPress={()=> this.OpenMenu(navigation)} style={styles.icon}/>
<View style={styles.header}>
<View style={{alignItems:'center'}}>
<Text style={styles.headerText}> {title} </Text>
</View>
</View>
</View> );}
use this header
<Stack.Screen name="Dashboard" component={Dashboard}
options={{
headerTitle:(navigation)=> <Header navigation={navigation} title={"Dashboard"}/>,
headerStyle: { backgroundColor: '#88aa31', }, headerLeft: null, }} />
can any tell me how can fix this issue