react-native-navigation

React native navigation 5 passing updated component

不问归期 提交于 2021-02-15 07:51:26
问题 I am new to react native and its navigation modules. I have a simple dashboard.js file where I am using tab navigator like this - <Tabs.Navigator tabBarOptions={{ activeTintColor: '#ff5757' }}> <Tabs.Screen options={{ tabBarIcon: ({ color }) => <Icon name='star-border' size={30} padding={15} color={color} />,}} name={'Orders'} component={Order} initialParams={{user}} /> <Tabs.Screen component= {AnotherComponent} /> As you can see I am passing InitialParams where I have user props. And I can

Redux dispatch in useEffect isn't syncronous

柔情痞子 提交于 2021-01-29 09:14:29
问题 I want to navigate to App screen or Auth screen, depending on the isUser prop after fetching it from the server and updating the redux store. My first component AuthLoading.js which looks like this: const AuthLoading = (props) => { const isUser = useSelector((state) => state.authReducer.isUserExists); const dispatch = useDispatch(); const fetchData = async () => { const token = await TokensHandler.getTokenFromDevice(); dispatch(isTokenExists(token)); props.navigation.navigate(isUser ? "App" :

React/RCTConvert.h file not found with ReactNativeNavigation ver3

为君一笑 提交于 2021-01-28 06:31:37
问题 I'm bilding mobile app the following technologies. react-native: v0.60.0 react-native-navigation: 3.0.0-alpha.2 And I build this app for iOS, then the following error message appears in the ReactNativeNavigation code. React/RCTConvert.h file not found The error file is Pods/Development Pods/ReactNativeNavigation/RNNOptions.h , and this is the content of it. #import <UIKit/UIKit.h> #import <React/RCTConvert.h> #import "BoolParser.h" #import "TextParser.h" #import "NumberParser.h" #import

Not able to switch between screens from class component ,every time throwing an error as undefined

与世无争的帅哥 提交于 2021-01-07 02:53:39
问题 I have the following code for intro slider import React, { Component } from 'react'; import { Dimensions,Platform,ScrollView,StyleSheet,View } from 'react-native'; import Button from './Button'; const { width, height } = Dimensions.get('window'); export default class OnboardingScreens extends Component { state = this.initState(this.props); /*** Initialize the state*/ initState(props) { // Get the total number of slides passed as children const total = props.children ? props.children.length ||

How to add badge to tab-bar in react-native?

笑着哭i 提交于 2020-12-31 05:40:28
问题 I am using the tabnavigator (createbottomBottomTabNavigator) and need help with the bage count using redux. 回答1: There is custom way to do this using redux, you can make your custom component using the same :- screen: NotificationScreen, navigationOptions: { tabBar: (state, acc) => ({ icon: ({ tintColor, focused }) => ( <BadgeTabIcon iconName="notification" size={26} selected={focused} /> ), visible: (acc && acc.visible !== 'undefined') ? acc.visible : true, }), }, }, where, export default

How to add badge to tab-bar in react-native?

回眸只為那壹抹淺笑 提交于 2020-12-31 05:39:43
问题 I am using the tabnavigator (createbottomBottomTabNavigator) and need help with the bage count using redux. 回答1: There is custom way to do this using redux, you can make your custom component using the same :- screen: NotificationScreen, navigationOptions: { tabBar: (state, acc) => ({ icon: ({ tintColor, focused }) => ( <BadgeTabIcon iconName="notification" size={26} selected={focused} /> ), visible: (acc && acc.visible !== 'undefined') ? acc.visible : true, }), }, }, where, export default

How to add badge to tab-bar in react-native?

谁都会走 提交于 2020-12-31 05:39:12
问题 I am using the tabnavigator (createbottomBottomTabNavigator) and need help with the bage count using redux. 回答1: There is custom way to do this using redux, you can make your custom component using the same :- screen: NotificationScreen, navigationOptions: { tabBar: (state, acc) => ({ icon: ({ tintColor, focused }) => ( <BadgeTabIcon iconName="notification" size={26} selected={focused} /> ), visible: (acc && acc.visible !== 'undefined') ? acc.visible : true, }), }, }, where, export default

Change the default light grey background color

北战南征 提交于 2020-12-15 05:43:05
问题 By default, every screen I created in react-native project use a very light grey color as its background color. As you see here: I wonder instead of I set backgroundColor for each screen of my project, is there a global place in react-native project that I can set the backgroundColor once for all screens in my project? For example, I would like all my screens use blue color as background color. 回答1: As you are already using react-navigation it has a theme provider which you can provide a

Error: Unable to resolve module ` react-native-screens` from `node_modules/react-navigation-tabs/src/navigators/createBottomTabNavigator.js`

谁说胖子不能爱 提交于 2020-12-08 05:21:38
问题 Current Behavior After executing app is not installing reporting bundling failed: Error: Unable to resolve module ` react-native-screens` from `node_modules/react-navigation-tabs/src/navigators/createBottomTabNavigator.js`: react-native-screens could not be found within the project. Your Environment | software | version | | react-navigation | 3.11.1 | react-native | 0.61.2 | node | 12.13.0 回答1: well i have solved this by reinstalling / updating these packages. npm install --save react-native