In react-navigation (before 5), I did achieved to that you say with passing upper navigation as a prop to downward using custom navigation component like this:
// this component's navigation is replaced by upper navigation, you can send another prop if you need both navigations.
const MyComponent0 = createStackNavigator(
{
Child1: {
screen: Child1,
navigationOptions: ({navigation}) => {
return {
headerRight: (
// you can use BackButton of library with import it, I wrote my own, that time i didn't know there is a ready importable back button.
<TouchableOpacity
style={{paddingLeft: 10}}
onPress={() => navigation.toggleDrawer()}>
<Icon ios="ios-menu" android="md-menu" style={{color: '#fff'}} />
</TouchableOpacity>
),
headerTitle: <Text style={styles.whiteText}>Child1 title</Text>,
headerLeft: (
<HeaderBackButton
style={{color: '#FFF'}}
onPress={() => navigation.goBack(null)}
/>
),
};
},
},
Child2,
...
},
{
defaultNavigationOptions: {
headerTitleStyle: {
color: '#fff',
fontSize: 13,
...Platform.select({
android: {
fontFamily: ...,
},
ios: {
fontFamily: ...,
},
}),
},
headerStyle: {
backgroundColor: 'rgba(0,0,0,1)',
},
headerTintColor: 'white',
},
},
);
class MyComponent1 extends Component {
constructor() {
super();
}
static router = MyComponent0.router;
render() {
return <MyComponent0 navigation={this.props.navigation} />; // you can send like navigation1 if you need downward navigation too.
}
}
This code is in old approach, but it works using react-navigation before 5.
I hope this helps you.