Not working with createSwitchNavigator when using react-navigation
See original GitHub issueThis library works flawlessly with createStackNavigator
but doesn;t work with createSwitchNavigator
.
I have a root layout all my components are wrapped with set like this.
This happens with react-navigation
library
render(){
{
return this.state.fontLoaded ?
(
<View style={{flex: 1}}>
{ this.props.children }
<FlashMessage position="top" titleStyle={{ fontFamily: 'maven-pro' }}/>
</View>
) : null
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Header not working in createSwitchNavigator - Stack Overflow
A switch navigator can't have a header. That's react-navigation's rule. Why don't you use the stack navigator instead? It won't cause any ...
Read more >createSwitchNavigator - React Navigation
The purpose of SwitchNavigator is to only ever show one screen at a time. By default, it does not handle back actions and...
Read more >How to use the react-navigation.createSwitchNavigator ... - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >How to Handle Navigation in React Native ... - freeCodeCamp
I always had issues with the old method (static) and it was really hard to change the navigation behavior dynamically. The old method...
Read more >react-navigation - npm
Start using react-navigation in your project by running `npm i react-navigation`. There are 593 other projects in the npm registry using ...
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 FreeTop 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
Top GitHub Comments
Hi @paschaldev I will close this issue since the main “problem” about
createSwitchNavigator
are solved.For your other trouble I’ve recommend you to use the FlashMessage option
floating={true}
:<FlashMessage position="top" floating={true} />
This option will modify a little the layout of FlashMessage, but will help eliminating the extra paddingTop inside the message.
Other option it’s don’t use the “androidStatusBar” thing in app.json. I don’t like this “straight fixed bar” of android since the other devices like iPhone (principle iPhone X, XR and XS) it isn’t possible to do it cause “the notch” of device. If you really need to made some black bar in android, you could use the StatusBar module of REACT NATIVE https://facebook.github.io/react-native/docs/statusbar#setbackgroundcolor and not this “androidStatusBar.backgroundColor”.
You could try something like that:
Thanks very much for your help @lucasferreira I appreciate