react-navigation-stack

How to pop multiple views off a navigation stack?

无人久伴 提交于 2020-08-25 05:18:10
问题 Looking for some guidance on a simple way to pop multiple views off a navigation stack in SwiftUI. I have 4 views chained together using NavigationLink. At the last view I would like to jump back to the initial ContentView, popping all the other views off the stack. I don't want to use the "Back" button on the NavigationBar of each view to achieve this. Thanks in advance. Bob. ''' import SwiftUI struct ContentView: View { var body: some View { NavigationView { VStack { NavigationLink

react-native createBottomTabNavigator shows weird tab bar on Android

烈酒焚心 提交于 2020-08-09 09:20:11
问题 I am using react-navigation createBottomTabNavigator to create a bottom tabs navigation. The tab bar appears fine on iOS but on Android, it appears as below: I am not sure what is causing to have this weird styling. Below is my code to create the bottom tab bar: <Provider store={store}> <NavigationContainer theme={GlobalConfig.theme}> <Tab.Navigator screenOptions={({route}) => ({ tabBarIcon: ({focused, color, size}) => { let iconSrc if (route.name === 'Alarms') { iconSrc = require('../img/ic

react-native createBottomTabNavigator shows weird tab bar on Android

允我心安 提交于 2020-08-09 09:20:01
问题 I am using react-navigation createBottomTabNavigator to create a bottom tabs navigation. The tab bar appears fine on iOS but on Android, it appears as below: I am not sure what is causing to have this weird styling. Below is my code to create the bottom tab bar: <Provider store={store}> <NavigationContainer theme={GlobalConfig.theme}> <Tab.Navigator screenOptions={({route}) => ({ tabBarIcon: ({focused, color, size}) => { let iconSrc if (route.name === 'Alarms') { iconSrc = require('../img/ic

Unable to resolve “@react-navigation/native” from “App.js” - React Native + How to Solve?

时光怂恿深爱的人放手 提交于 2020-08-02 12:24:21
问题 undefined Unable to resolve module @react-navigation/native from App.js : @react-navigation/native could not be found within the project. If you are sure the module exists, try these steps: 1. Clear watchman watches: watchman watch-del-all 2. Delete node_modules: rm -rf node_modules and run yarn install 3. Reset Metro's cache: yarn start --reset-cache 4. Remove the cache: rm -rf /tmp/metro-* - node_modules\react-native\Libraries\Utilities\HMRClient.js:307:41 in showCompileError - node_modules

Is is possible to use navigation.toggleDrawer() in navigation options

爷,独闯天下 提交于 2020-07-16 07:57:26
问题 In my navigation file , when I want to toggle drawer , get the following error : TypeError: navigation.openDrawer is not a function.(In 'navigation.openDrawer()', 'navigation.openDrawer' is undefined) This is my drawer: const DrawerNavigator = () => { return ( <Drawer.Navigator initialRouteName="MYSHIFT" > <Drawer.Screen name="MYSHIFT" component={TopTabNavigator} /> </Drawer.Navigator> ) } And this is my container navigation : const CareworkerNavigation = () => { return ( <NavigationContainer

How do I hide material bottom tab navigator in a nested stack navigator in react native

馋奶兔 提交于 2020-07-09 12:48:29
问题 I'm using material Bottom Tab Navigator, My app is structured such that, some tabs contain a stack navigator. I want to hide the bottom tabs when a user navigates to another stack in the stack navigator. I'm using react navigation v5. I don't want the bottom tabs showing when a user has already navigated to a stack. 回答1: I made you a basic example of what you're asking. I hope this what you're looking for : import React from 'react' import { Button, View, Text, StyleSheet } from 'react-native

react navigation 5 hide bottom tab nav in nested navigation

陌路散爱 提交于 2020-06-29 06:41:11
问题 The structure of my react navigation is like this : BottomTabNavigator => Navigator => Components This is the skeleton of the App.js. The whole application is wrapped up in a bottom tab navigation. import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; const BottomTab = createBottomTabNavigator(); function App() { return ( <NavigationContainer> <BottomTab.Navigator > <BottomTab.Screen name="Main" component={MyVeranda} options={{ tabBarLabel: 'Home', tabBarIcon: //...some

Undefined is not an object 'navigation.navigate' React Native Navigation 5 (NEW)

回眸只為那壹抹淺笑 提交于 2020-05-17 03:55:52
问题 I am doing doing navigation with new react native navigation all I want is when button is pressed it navigate to next screen, I have followed new documentation but the problem is I am doing with classes and in the documentation all the work is done with functions in App.js, I tried to modify my code accordingly but couldn't do with classes as onPress button it does not navigate instead gives me error. This is my app.js: import * as React from 'react'; import { Button, View, Text } from 'react

Undefined is not an object 'navigation.navigate' React Native Navigation 5 (NEW)

蹲街弑〆低调 提交于 2020-05-17 03:54:49
问题 I am doing doing navigation with new react native navigation all I want is when button is pressed it navigate to next screen, I have followed new documentation but the problem is I am doing with classes and in the documentation all the work is done with functions in App.js, I tried to modify my code accordingly but couldn't do with classes as onPress button it does not navigate instead gives me error. This is my app.js: import * as React from 'react'; import { Button, View, Text } from 'react

How to use createMaterialTopTabNavigator as a component

安稳与你 提交于 2020-04-16 05:50:32
问题 Hey I have a search screen "search for songs/artists" So after sending the request i want to appear a "Top Tabs", So I add a Top tab "createMaterialTopTabNavigator" inside separate files and then import it as a component to use it inside Search Screen like this <SearchTabs /> But i got an error Invariant Violation: The navigation prop is missing for this navigator. In react-navigation v3 and v4 you must set up your app container directly. More info: https://reactnavigation.org/docs/en/app