-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Navigate to different screen from a button in a header #286
Comments
Hi @KakarN
|
Thank you @sigmazen So the final code looks like this:
And within the SearchNotification component:
|
I stumbled into the same problem and tried to implement the solution that you suggested but got the following error
If you could help me out it would be much appreciated. the offending components:
|
According to documentation we need to pass prop to headerRight component using method instead of object. |
Could you clarify? |
onPress={() => navigate('Detailed')} |
<Button transparent onPress={() => navigate('Main')}> |
This is what you're looking for @sclanc: static navigationOptions = {
headerRight: <Button title="Info" />,
... |
You can try this code @sclanc
|
I also have the same problem @shruti8597 ,
can you please help me? |
@Digant312 Try this instead:
|
@nathan815 Thanks man, worked like a charm |
I have the navigation as follows:
StackNavigator:
- TabNavigator, // HomeNavigation
- TabNavigator // NotificationNavigation
HomeNavigation has a header, and the header has a right component of
SearchNtofication
.SearchNotification
has an icon which on press I would like to go to the NotificatoinNavigation.However, if I make changes to the header of HomeNavigation to this way, the SearchNotification is not not displayed in the header.
How can I navigate to different screen from a button in a header?
The text was updated successfully, but these errors were encountered: