react-navigation

How to get access to reducer inside App using React Navigation v5 in React Native?

眉间皱痕 提交于 2020-03-05 00:21:34
问题 I'm trying to build app with React Navigation v5 and stuck with Authentication flow. Here is some code to understand what I'm trying to do: const Stack = createStackNavigator(); const Drawer = createDrawerNavigator(); const AuthContext = React.createContext(); export default class App extends Component { // constructor() ... render() { const store = configureStore(); // rootReducer return ( <AuthContext.Provider store={store}> <NavigationContainer> // here I have to access my userReducer to

How to hide react navigation header on one screen

岁酱吖の 提交于 2020-03-04 16:39:33
问题 I need to hide the navbar on the landing page of an app I tried this: const Stack = createStackNavigator( { Landing: {screen: LandingScreen}, }, { headerMode: 'none', navigationOptions: { headerVisible: false, }, }, ); But i get an error saying: "Creating a navigator does'nt take an argument..." When I use headerMode="none" it hides the navbar on all screens <NavigationContainer> <Stack.Navigator headerMode="none" // this hides on all screens screenOptions={{ headerStyle: { backgroundColor: '

Delay in tap response when using TransitionPresets

血红的双手。 提交于 2020-03-03 07:29:19
问题 UPDATE: The problem seems to come when I use animation using ...TransitionPresets.SlideFromRightIOS . I have a simple screen where on tapping a touchableOpacity it navigates to another screen with some parameters. The issue is that sometimes I need to tap twice to move to another screen. I am not sure why this happens. DEMO: App.js <SafeAreaProvider> <NavigationContainer> <Stack.Navigator screenOptions={{ headerStyle: { elevation: 0, }, headerTitleStyle: { fontFamily: "Google Sans Regular",

React native navigationOptions calling function error

元气小坏坏 提交于 2020-03-01 20:39:18
问题 Got an error when call a function inside navigationOptions . static navigationOptions = { tabBarIcon: ({ tintColor })=> ( <Icon name='ios-add-circle' style={{ color: tintColor}} /> ), tabBarOnPress: () => { this.callingFun(); }, } callingFun = ()=> { console.log('tabBarOnPress:'); } Error: 回答1: You can not call callingFun in static object property. I think that you want this static navigationOptions = ({navigation}) => { return { tabBarIcon: ({ tintColor }) => ( <Icon name='ios-add-circle'

Block/Disable tabs in TabNavigator - react-navigation

筅森魡賤 提交于 2020-03-01 04:44:37
问题 I have a TabNavigator as shown in the picture. Header Image I am using TabNavigator for creating these tabs as below. const Tab_Navigator = TabNavigator({ First:{ screen: First, }, Second:{ screen: Second, }, Third:{ screen: Third, }, Now I want to block/disable "Second" and "Third" tabs. It should be visible but one shouldn't able to navigate to them. I tried blocking these tabs as shown here but I guess I am missing something. My try: Tab_Navigator.router.getStateForAction = (action, state)

React-Navigation adding drawer navigation with tab

☆樱花仙子☆ 提交于 2020-02-27 12:16:39
问题 I'm using react-navigation ("^3.0.9") with expo. This is my logic flow: TabView(BottomTabNavigator) with StackNavigatior: HomeStack --HomeScreen ... LinksStack --LinkScreen ... SettingsStack -- Aboutscreen ... Everything works ok, but now I would like to add a drawer navigation (hamburger menu) as follows: DrawerNavigation View --HomeScreen(which will show HomeScreen with 3 tabs) --Screen2 (no tabs) --Screen3 (no tabs) Which I tried to do the following: export const Tab =

How can i access to redux store with react navigation?

☆樱花仙子☆ 提交于 2020-02-26 04:19:47
问题 I have App "Music App" for tow users type "Guest, a user registered" I have a bottom navigator for those, When Guest opens my app I want to render just 4 bottom tabs "Home, browse, search, radio". but when user login/register I want to render 5 tabs previously tabs plus "Library" Tab. SO I dispatch action when user register\login , and change isLogin state from false to true and work some stuff like add some other data to my drawer and it appears fine tho, I want to access to redux store

How can i access to redux store with react navigation?

风格不统一 提交于 2020-02-26 04:17:49
问题 I have App "Music App" for tow users type "Guest, a user registered" I have a bottom navigator for those, When Guest opens my app I want to render just 4 bottom tabs "Home, browse, search, radio". but when user login/register I want to render 5 tabs previously tabs plus "Library" Tab. SO I dispatch action when user register\login , and change isLogin state from false to true and work some stuff like add some other data to my drawer and it appears fine tho, I want to access to redux store

How can i access to redux store with react navigation?

戏子无情 提交于 2020-02-26 04:17:07
问题 I have App "Music App" for tow users type "Guest, a user registered" I have a bottom navigator for those, When Guest opens my app I want to render just 4 bottom tabs "Home, browse, search, radio". but when user login/register I want to render 5 tabs previously tabs plus "Library" Tab. SO I dispatch action when user register\login , and change isLogin state from false to true and work some stuff like add some other data to my drawer and it appears fine tho, I want to access to redux store

Add custom icon to drawer navigation

╄→гoц情女王★ 提交于 2020-02-22 07:41:59
问题 I am trying to add custom icon to my CustomDrawerComponent, but nothing happen... App.js : const navigationOptions = { headerTintColor: colors.white, }; const drawerNavigationOption = ({ navigation }) => ({ ...navigationOptions, headerLeft: ( <TouchableOpacity onPress={() => navigation.toggleDrawer()}> <View> <Icon name="menu" size={24} color={colors.white} /> </View> </TouchableOpacity> ), }); const MapsStackNavigator = createStackNavigator({ MapsNavigator: { screen: MapsScreen,