Home.navigationOptions dosn't work with components being passed through firebase context
See original GitHub issuechanging navigation options when passing the component though the context api dosn’t work.
Apps.navigationOptions = { title: 'Apps' } export default withFirebaseHOC(Apps)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
React-Navigation with Login Screen - Stack Overflow
Be inside a component adding code, where you have this.props.navigation available · Make a component like <Something /> · Pass navigation into it, ......
Read more >Function to set this.state.isLoading to false doesn't work inside ...
Coding example for the question Function to set this.state.isLoading to false doesn't work inside navigationOptions-React Native.
Read more >Troubleshooting | React Navigation
Troubleshooting. This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation.
Read more >navigation.navigate is undefined - You.com | The Search Engine ...
So, your problem is conceptual here. React components receive a single object, named props , that contains all the props . Normally, you...
Read more >Navigate to a destination - Android Developers
Navigating to a destination is done using a NavController , an object that manages app navigation within a NavHost .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @iamwill123
Apologies for getting back to you on so late. Feel free to submit a PR on this. However, do note that, in future, I will be upgrading react-navigation to v5 and thus, the firebase auth methods consumption might change.
A big thank you for the above solution ❤️
@jim-alexander I believe this will help as I had this same question and issue. I did some digging and adapted some code into this:
context.js:
The key was coping the static methods by using the hoist-non-react-statics package. This solved my
static navigationOptions
issue on each screen.References for the solution: https://kentcdodds.com/blog/mixing-component-patterns https://www.npmjs.com/package/hoist-non-react-statics https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over
@amandeepmittal, this might be a worthwhile PR. I have a few more additions to this starter which is awesome by the way.
Hope it helps, Will