New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header for DrawerNavigator #68
Comments
+1 |
I worked on this problem today, and the approach I came up with for now is to create a class factory function (~ HOC) that takes a component and renders the drawer header around it. To actually do it properly is a bit trickier since you will want to use I'll post a sample tomorrow (need to generalize it a little first). |
What do you mean by a classical header? Do you have a mock-up or screenshot of what you want? |
Something like this: I've continued playing around with this and I just managed to get it working, with the one issue still that the hamburger is misaligned, but that's probably just due to the component I'm using. What I did was fetch react-navigation from github instead of using the version on npm, this fixed the header not appearing and also fixed the "header: left" property so the left button actually appears, as well as an issue with the drawer going behind the header. The working approach I have right now looks something like this:
CompX without header property renders the back button as expected. |
Yes, the |
Thanks for the awesome work on this library!
I'd like to use the classical header with a hamburger pattern in combination with the DrawerNavigator but I can't figure out how to do so apart from manually including the header in every screen where I want it rendered, which seems a bit redundant. Is that actually how I should do it or is there a better way?
An example including a header would be much appreciated. Examples of StackNavigator nested behind DrawerNavigator would be nice too.
The text was updated successfully, but these errors were encountered: