-
-
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
Navigation Button Action #2029
Comments
Can't understand what do you want to express.Found a bug or Looking for a solution. If you are looking for a solution, you should show your difficulties. |
@oxape, I'm looking for a solution. Please check out my stackoverflow post: https://stackoverflow.com/questions/44809807/react-native-navigation-action-using-components-state Thank you!! |
Basically I have a Post button in the top right corner and I would like it to call the Here is my current code, and the state comes up undefined in the
Any ideas how to accomplish what I'm looking for? @oxape |
Attempting to access |
@matthamil |
@oxape Check out this PR review when |
Thanks @matthamil I'll check it out! Looks good 👍 |
Same problem here. Thanks @matthamil and @oxape for the context and solution (works great). That PR makes it clear why it's not possible to access the component's scope inside the navigation options. That being said, would it not be great if it would be possible to access the Component (and it's state) from within the options?
No clue on how to implement it though.. but maybe you guys have? |
Hi! In an effort to get the hundreds of issues on this repo under control I'm closing issues tagged as questions. Please don't take this personally - it's simply something we need to do to get the issues to a manageable point. If you still have a question I encourage you to re-read the docs, ask on StackOverflow, or ask on the #react-navigation Reactiflux channel. Thank you! |
Issue Description
I would like to make it so that a navigation button on press triggers a method on the respective component that's being displayed. The reason for this is becasue I've made a full-screen TextInput, and would like it so when they click the Post button in the top right corner, it will trigger the
post()
action on the component. The reason the post() action is on the component is because as they type, I'm updating the state to hold the value of what is in the TextInput.Steps to Reproduce / Code Snippets / Screenshots
Here's my current navigation code:
Here's what it currently looks like:
The text was updated successfully, but these errors were encountered: