react-navigation

How do i keep initial route with nested navigation with React Navigation v5?

╄→尐↘猪︶ㄣ 提交于 2021-02-05 12:20:33
问题 First let me state that I know how to navigate from one nested page to another using react navigation. However, whenever i navigate to a nested screen that is not the initial route, that screen now become the first screen whenever i navigate back to that nested stack. Example . Parent Navigator Nested Stack Navigator 1 screen A (Initial Route) screen B Nested Stack Navigator 2 screen C (Initial Route) screen D Nested Stack Navigator 2 screen E (Initial Route) screen F Normally when navigating

How do i keep initial route with nested navigation with React Navigation v5?

天涯浪子 提交于 2021-02-05 12:20:12
问题 First let me state that I know how to navigate from one nested page to another using react navigation. However, whenever i navigate to a nested screen that is not the initial route, that screen now become the first screen whenever i navigate back to that nested stack. Example . Parent Navigator Nested Stack Navigator 1 screen A (Initial Route) screen B Nested Stack Navigator 2 screen C (Initial Route) screen D Nested Stack Navigator 2 screen E (Initial Route) screen F Normally when navigating

React Navigation 5 Auth Flow

杀马特。学长 韩版系。学妹 提交于 2021-02-05 11:40:26
问题 In my React Native app, I'm using React Navigation 5 and trying to route users to authentication stack if the user is not authenticated i.e. there's no access_token in AsyncStorage . What I'm confused about is how to get the token from AsyncStorage because it's an asynchronous process. I can't seem to await the call in my App component i.e. it gives me an error if I try and if I don't await it, then I get a promise . How do I implement this using React Navigation 5 ? Here's my App component:

react-native material top tab navigator swipe disable depending on screens

China☆狼群 提交于 2021-02-05 08:39:06
问题 Wanna make only Map component swipe-disabled but the entire screens were applied when using "swipeEnabled". How can I do? const Tab = createMaterialTopTabNavigator(); const Tabs = () => { return ( <Tab.Navigator swipeEnabled={false} // <- Screens can be swiped but it is applied to every screen. {...} > <Tab.Screen name="Home" component={Home} /> <Tab.Screen name="Map" component={Map} /> </Tab.Navigator> ); } const App = () => { return ( <NavigationContainer> <SafeAreaView style={styles

react-native material top tab navigator swipe disable depending on screens

↘锁芯ラ 提交于 2021-02-05 08:39:05
问题 Wanna make only Map component swipe-disabled but the entire screens were applied when using "swipeEnabled". How can I do? const Tab = createMaterialTopTabNavigator(); const Tabs = () => { return ( <Tab.Navigator swipeEnabled={false} // <- Screens can be swiped but it is applied to every screen. {...} > <Tab.Screen name="Home" component={Home} /> <Tab.Screen name="Map" component={Map} /> </Tab.Navigator> ); } const App = () => { return ( <NavigationContainer> <SafeAreaView style={styles

Header with TabNavigation React Navigation

半腔热情 提交于 2021-02-04 21:47:25
问题 What is the best way to have a header with the page title with a tab navigator with react native? I know there is a way to wrap you TabNavigator inside of StackNavigator, but I do not understand how to do this with different components in different classes... This is what I am doing to set up the TabNavigator: Inside App.js: export default createBottomTabNavigator( { Activity: Activity, Front: Front }, { navigationOptions: ({ navigation }) => ({ tabBarIcon: ({ focused, horizontal, tintColor }

React Navigation 4.x version issue when navigating to other screen

白昼怎懂夜的黑 提交于 2021-01-29 15:07:49
问题 When Using react-navigation version 4.1.1 When navigating from one screen to another screen it is fluctuating and i am using ImageBackground there ,so first white blank screen appears after that imagebackground is loading which is very slow and i can easily see the transition over there . I dont know what's the exact issue is there. And for this new version i have to install libraries also for react navigation i.e.react-native screens,animated and maskedView ,safeareacontext. So please any

How can I fix this - undefined is not an object (evaluating 'label.toUpperCase')

旧城冷巷雨未停 提交于 2021-01-29 10:21:37
问题 How can I fix this error in React Navigation V3?.................................................................................................................................................................................................................................................................................................................................................................................................................................................................

How to combine tab and stack navigation props in reactnavigation typescript react native

别来无恙 提交于 2021-01-29 10:03:51
问题 I am trying to combine two navigation props But I am not sure how to do this. Earlier when I used to define only one route I used to do something like this. export type MatrimonyStackRoutes = { Matrimony: undefined; GroomDetail: undefined; }; export type MatrimonyStackNavigationProps< T extends keyof MatrimonyStackRoutes > = { navigation: StackNavigationProp<MatrimonyStackRoutes, T>; route: RouteProp<MatrimonyStackRoutes, T>; }; <Stack.Navigator> <Stack.Screen name="Matrimony" component=

React-Navigation: Invariant Violation: Element type is invalid: expected a string but got undefined

冷暖自知 提交于 2021-01-29 08:16:00
问题 I'm getting an error while using StackNavigator of React-Navigation. Following I'm showing you my code, the version that I have, and all my configuration of package.json Here is the code: import {React} from 'react' import { StackNavigator } from 'react-navigation'; import LoginForm from '../view/screen/LoginForm' import Setting from '../view/screen/Setting' export const AppNavigator = StackNavigator({ Login: { screen: LoginForm }, Setting: { screen: Setting } }); This is my configuration: 1.