I want to navigate to a particular screen using a common header button in the stack navigator.
<NavigationContainer>
<RootStack.Navigator
mode="modal"
screenOptions={{
headerTitleAlign: 'center',
headerTitle: () => <SpreeLogo />,
headerRight: (props) => <MaterialIcons style={{
marginHorizontal: 10,
}}
onPress={() => console.log(props)}
name="clear" size={28} color="black" />
}}
>
In the header right icon I would like to have access to the navigation prop. I've tried console logging the prop but there is no prop as navigation. How to get access to it?