API to make it possible to have interactions between navigators while still decoupling them
closed
satya164
closed
I'm closing this because this is not technically possible - since data flow is always from parent to child in React. We already do some adjustments based on nesting (e.g. extra statusbar height would be removed in a nested stack). We also have added more features to individual navigators such as headers in most navigators and not just stack which removes the need for this.
Sandeep Jaiswal
Create a header component suppose <ParentHeader />
make it's visibility driven from redux, then this can be controlled from any component.
It works like a charm
many other functionality can be implemented using redux, making one single header work through out the application
Jesper Madsen
Another use case not mentioned:
If you have Stack1 - Tab - Stack2, and the tab needs a custom header, I can currently not see any way of having a header that is 'sticky'/permanent/persistent as it should be. The only way to obtain something like this at the moment (as far as I can tell) is to have
navigationOptions: { header: null }
on the Tab route of Stack1, and then set
static navigationOptions = ({ navigation }) => ({
header: <HeaderComponent />,
),
});
on each tab screen. This provides the custom header without the double header from the parent Stack1, but it
switches
with the tabs as shown on this gif: Please correct me if I'm wrong
EDIT: Got damn Canny for not supporting markdown