react-navigation

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

Error: undefined Unable to resolve module `@react-navigation/bottom-tabs`

一笑奈何 提交于 2020-07-23 07:39:04
问题 Been searching for a solution about the error module on navigation. I've tried reset-cache, deleting nodu_modules, reinstall the module but still its not working. Full details of the error Unable to resolve module `@react-navigation/native` from `src/App.js`: @react-navigation/native could not be found within the project. Package.json "@react-native-community/masked-view": "^0.1.9", "native-base": "^2.13.12", "react": "16.9.0", "react-native": "0.61.5", "react-native-gesture-handler": "^1.6.1

Error: undefined Unable to resolve module `@react-navigation/bottom-tabs`

女生的网名这么多〃 提交于 2020-07-23 07:38:07
问题 Been searching for a solution about the error module on navigation. I've tried reset-cache, deleting nodu_modules, reinstall the module but still its not working. Full details of the error Unable to resolve module `@react-navigation/native` from `src/App.js`: @react-navigation/native could not be found within the project. Package.json "@react-native-community/masked-view": "^0.1.9", "native-base": "^2.13.12", "react": "16.9.0", "react-native": "0.61.5", "react-native-gesture-handler": "^1.6.1

Error: undefined Unable to resolve module `@react-navigation/bottom-tabs`

倾然丶 夕夏残阳落幕 提交于 2020-07-23 07:37:14
问题 Been searching for a solution about the error module on navigation. I've tried reset-cache, deleting nodu_modules, reinstall the module but still its not working. Full details of the error Unable to resolve module `@react-navigation/native` from `src/App.js`: @react-navigation/native could not be found within the project. Package.json "@react-native-community/masked-view": "^0.1.9", "native-base": "^2.13.12", "react": "16.9.0", "react-native": "0.61.5", "react-native-gesture-handler": "^1.6.1

set dynamic 'initialRouteName' in react-native

社会主义新天地 提交于 2020-07-20 07:04:36
问题 question is simple I know there are lots of answers available for the same question but I have differently set my own App.js file i tried almost all but no success. so my App.js looks like this import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View, StatusBar } from 'react-native'; import { createStackNavigator } from 'react-navigation'; import { Header, Button, Spinner } from './src/components/comman'; import SplashScreen from 'react-native-splash-screen'; import

Send props on navigation goBack

只谈情不闲聊 提交于 2020-07-18 07:27:47
问题 Basically I have three screens, the first is a stack navigator: const stackNav = createStackNavigator({ Main: { screen: MainScreen, navigationOptions:({navigation}) => ({ header: null, }) }, Detail: { screen: DetailScreen, navigationOptions: (props) => ({ title: "Detail", }) } }) The second one I have a button to go to the Detail screen: <TouchableOpacity onPress={() => this.props.navigation.navigate("Detail", {name: l.name, subtitle: l.subtitle})}> The last one is just information, I would

Differences between this.props.navigation.dispatch vs this.props.navigation.navigate?

允我心安 提交于 2020-07-18 04:19:10
问题 I see a lot of folks in the react-navigation issues section using this.props.navigation.dispatch to programmatically navigate. Is there any specific reason or use case to use that over this.props.navigation.navigate ? It seems like you can pass more options to the dispatch function? Is there anything else? Can you use dispatch without explicitly tying react-navigation into your apps redux store? Right now I have an app that has redux, but I dont explicitly configure my redux setup to know

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

Have a stack navigator always render initialRoute

放肆的年华 提交于 2020-07-10 10:18:27
问题 I'm building a react native app and I'm using react-navigation package. I have a tab navigator for the app and each tab has a stack navigator in it. Something like this: const HomeStack = StackNavigation({ Info: {screen: Info}, Main: {screen: Main} }) const SearchStack = StackNavigation({ Search: {screen: Search}, SearchResult: {screen: SearchResult} }) TabNavigation({ Home: {screen: HomeStack}, Search: {screen: SearchStack} }) So let's say I did a search and I'm now on SearchResult screen. I

React-Navigation passing functions to screenProps

会有一股神秘感。 提交于 2020-07-10 08:21:45
问题 I am creating an app using React Native, Expo and React Navigation, and I don't know the correct method for passing props and functions around. I have copied the Expo method for navigators that I will build on, but right now I just have App.js calling the following AppNavigator -> MainSwitchNavigator -> HomeScreen I have then wrapped the main exported App that Expo expects with the Amazon AWS Amplify HOC withAuthenticator. Now I can log in to my app and show hello world securely using Amazon