react-navigation

icons not showing on TabNavigator

谁说胖子不能爱 提交于 2020-01-06 03:21:04
问题 Icon not showing in TabNavigator. My code: import React, { Component } from 'react'; import { AppRegistry, Text, View } from 'react-native'; import { StackNavigator,TabNavigator } from 'react-navigation'; import TestComp1 from './src/components/TestComp1' import TestComp2 from './src/components/TestComp2' import TestComp3 from './src/components/TestComp3' import TestComp4 from './src/components/TestComp4' import TestComp5 from './src/components/TestComp5' export default class myApp extends

React Navigation: How to hide specific tab from bottomTabNavigator based on logged in user role?

此生再无相见时 提交于 2020-01-05 06:33:38
问题 I have a bottom tab navigator in my screen with this structure ( HomeScreen.js ): export default createBottomTabNavigator( { Home: HomeStack, Transactions: TransactionsTab, Customers: CustomersStack, Settings: SettingsTab }, { navigationOptions: ({ navigation }) => ({ tabBarIcon: ({ focused, tintColor }) => { const { routeName } = navigation.state; let iconName; if (routeName === 'Home') { iconName = `home`; } else if (routeName === 'Transactions') { iconName = `file-text`; } else if

React Navigation: How to hide specific tab from bottomTabNavigator based on logged in user role?

蓝咒 提交于 2020-01-05 06:32:37
问题 I have a bottom tab navigator in my screen with this structure ( HomeScreen.js ): export default createBottomTabNavigator( { Home: HomeStack, Transactions: TransactionsTab, Customers: CustomersStack, Settings: SettingsTab }, { navigationOptions: ({ navigation }) => ({ tabBarIcon: ({ focused, tintColor }) => { const { routeName } = navigation.state; let iconName; if (routeName === 'Home') { iconName = `home`; } else if (routeName === 'Transactions') { iconName = `file-text`; } else if

React Native Call Screen Function from Header

為{幸葍}努か 提交于 2020-01-05 06:31:27
问题 I have update password function inside ScreenPassword , but I want to update password by tapping Save button on screen header. NavSettings.js const routeConfigs = { Password: { screen: ScreenPassword, navigationOptions: { headerTitle: 'Password', headerTintColor: '#000', headerRight: ( <View style={styles.headerRight}> <Button style={styles.buttonHeader} color='#000' title="Save" onPress={???????????} /> </View> ) } } } export default createStackNavigator(routeConfigs); ScreenPassword export

undefined is not an object (evaluating 'this.props.navigation') react navigation

て烟熏妆下的殇ゞ 提交于 2020-01-05 05:33:08
问题 I'm using React Stack Navigator in React Native App. I have a problem with the navigation props. Here is my component where I call my navigate method. class CommandsList extends React.Component { constructor(props){ super(props); } addCommand(){ this.props.navigation.navigate("CreateCommand"); } render() { return ( <SafeAreaView style={{flex:1}}> <MyList itemsUrl="http://localhost:9000/commands"/> <Button title="Ajouter" onPress={this.addCommand}></Button> </SafeAreaView> ); } } export

Make a reusable component in react native?

夙愿已清 提交于 2020-01-05 04:31:13
问题 I make a reusable component to render a Flatlist and inside I have a TouchableOpacity when pressed it I want to navigate to a specific screen, and I pass some params based on items inside FlateList So when I pressed to navigate i got an error can't read property navigate of undefined here is my code const OrdersList = props => { return ( <View style={styles.container}> <FlatList data={props.data} renderItem={({item}) => { return ( <TouchableOpacity onPress={() => props.navigation.navigate

StackNavigator title not showing in simplest example

时间秒杀一切 提交于 2020-01-04 05:42:08
问题 I just started React Native development, installed Expo , created an app (works), installed react-navigation and tried the first StackNavigator example using the example from https://reactnavigation.org/docs/intro/. I am running npm run ios from the commandline, and using Nuclide IDE. All of which are completely new to me. The problem is, that on running the example the screen in the iOS emulator shows this: Instead of showing a title bar with 'Welcome' on it. As a beginner I have no clue

Using mobx store in react-navigation createStackNavigator

不想你离开。 提交于 2020-01-04 05:20:23
问题 I would like to use Mobx store variable in createStackNavigator in react-navigation. Specifically, I would like to change the initial route dynamically (so that user can change the initial screen) using the store. would this be possible? Something in the line of... const stack = createStackNavigator({ Home:{ ... }, { initialRouteName: this.props.store.initialScreen { }) Because this is not a class, I cannot integrate mobx store. Any ideas to change the initialRoute dynamically is appreciated!

React Navigation Tabs not Clickable with absolute position

有些话、适合烂在心里 提交于 2020-01-04 02:15:07
问题 I have 2 screen in react native and I wanna make the tabs navigator transparent, it works but the navigator not clickable after adding position: absolute , if I'm not using the absolute the background turning white (can't transparent) this is my tabBarOptions tabBarOptions: { showIcon: true, showLabel: true, activeTintColor: 'orange', inactiveTintColor: '#fff', style: { width: '100%', height: 60, backgroundColor: 'transparent', borderTopWidth: 0, position: 'absolute', left: 0, right: 0,

The component for route 'ActivityFeed' must be a React component

夙愿已清 提交于 2020-01-03 21:17:46
问题 I have looked through various similar posts here on SO regarding similar issue, but none of the answers solved it for me. This is the full error: So in my src/navigation/feed/stack.js its being defined like so: import React from 'react'; import {StackNavigator} from 'react-navigation'; import ActivityFeed from 'activity-feed/session-user/screens/Main'; import HamburgerButton from 'navigation-components/HamburgerButton'; import HeaderTitle from 'navigation-components/HeaderTitle'; import