react-native

ReferenceError: Can't find variable: navigation

匆匆过客 提交于 2021-02-10 15:05:12
问题 So what I'm trying to do is that I'd like the DrawerNavigator to be accessed by selecting the icon on the top left . Im using react nav 5 for this. I keep recieving the error displayed above. I've tried doing this using this.props.navigation but that also did not seem to work. Assistance would be greatly appreciared AppNavigator: /* eslint-disable no-unused-expressions */ import React, { useState, useEffect } from 'react' import { NavigationContainer, DrawerActions } from '@react-navigation

react-native google translater

时光怂恿深爱的人放手 提交于 2021-02-10 14:51:57
问题 I have developed an android mobile app using react-native. My native language for the app is English but I want to make it available in Mandarin Chinese also. So my question is how can I convert my static and fetched data into Mandarin Chinese. please share a solution. 回答1: Yes, you can do it. For changing the Application language to multi-language app,i.e., also include Mandarin Chinese. For Static contents/text Use the package react-native-i18n Link : https://www.npmjs.com/package/react

React Native Reusable Card Component won't Visualize as expected

本小妞迷上赌 提交于 2021-02-10 14:47:30
问题 Hello there I'm new to react native. I'm trying to create reusable component, not only card component, maybe in future will create other reusable components. Below is the code example of reusable card component that I've created: Card.js import React from 'react'; import { View, StyleSheet } from 'react-native'; const Card = props => { return ( <View style={{...styles.card, ...props.style}}>{props.children}</View>);}; const styles = StyleSheet.create({ card: { shadowColor: 'black',

How do I navigate from one screen to another in react native using props?

社会主义新天地 提交于 2021-02-10 14:39:55
问题 I have my initial screen which works as expected: function MyTabs() { return ( <Tab.Navigator> <Tab.Screen name="Schools" component={MainScreen} /> <Tab.Screen name="Other" component={OtherScreen} /> </Tab.Navigator> ); } const Tab = createBottomTabNavigator(); function App() { return ( <NavigationContainer> <MyTabs /> </NavigationContainer> ); } export default App; It shows 3 option for screens on the bottom. When I am on the Main screen I see list of objects, I call them schools. Each

Unable to resolve “../../App” from “node_modules/expo/AppEntry.js”

倖福魔咒の 提交于 2021-02-10 14:35:28
问题 I am making a vue-native app with expo. when upgrading to expo version 33 I get the following error "Unable to resolve "../../App" from "node_modules/expo/AppEntry.js". The need to upgrade to version 33 is because I need the expo filesystem module. I have already made a new project from scratch and the same error still occurs. package.json { "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo

React-Native App getting crashed on navigate

£可爱£侵袭症+ 提交于 2021-02-10 14:21:06
问题 After upgrading React-Native App to below configuration "react": "16.9.0", "react-native": "0.61.5", "react-navigation": "^4.0.10", "react-navigation-stack": "^1.10.3", "react-navigation-drawer": "^2.3.3", "react-redux": "^7.1.3", "redux": "^4.0.4", "redux-promise": "^0.6.0", "redux-saga": "^1.1.3" App getting crashed when redirecting using "this.props.navigation.navigate()" from createStackNavigator page. But when I redirect from createDrawerNavigator to the same page it works. Before

Review validation fails in react-native

谁说胖子不能爱 提交于 2021-02-10 14:15:26
问题 I am new to react native. I have used the package react-native-rate for rate my application in ios store/google playstore. but it ignores in the below cases. CASE 1: 1) While showing Rating prompt, when the user press the OK Button to add a review, Application will redirect to ios store/google playstore. 2) If the user exit without adding review, then application considering as review added. 3) Could you please let me know how to validate the added the review or not. CASE 2 : 1) Currently, I

Expo + React Native - PDF Creation & Download

做~自己de王妃 提交于 2021-02-10 14:04:28
问题 Is there a reliable way to create a file (specifically via Print.printToFileAsync API), and since it creates the new file in the user's cacheDirectory, copy it across to their documentDirectory - that works in both Android and iOS? I've come across others trying to do the same thing here, but to no avail. One solution I've seen is to use the MediaLibrary API to download the file to the device's CameraRoll - but this is hacky and doesn't work on iPhone since the file I'm trying to copy

null is not an object (evaluating 'ShareDialog.canShow')

那年仲夏 提交于 2021-02-10 13:52:04
问题 I have an code like this: import React, { Component } from 'react'; import {AppRegistry, StyleSheet, Text, TouchableHighlight, View,} from 'react-native'; import {LoginButton, ShareDialog} from 'react-native-fbsdk'; class RNSample extends Component { constructor(props) { super(props); const shareLinkContent = { contentType: 'link', contentUrl: 'https://www.facebook.com/', contentDescription: 'Facebook sharing is easy!' }; this.state = {shareLinkContent: shareLinkContent,}; }

null is not an object (evaluating 'ShareDialog.canShow')

☆樱花仙子☆ 提交于 2021-02-10 13:51:44
问题 I have an code like this: import React, { Component } from 'react'; import {AppRegistry, StyleSheet, Text, TouchableHighlight, View,} from 'react-native'; import {LoginButton, ShareDialog} from 'react-native-fbsdk'; class RNSample extends Component { constructor(props) { super(props); const shareLinkContent = { contentType: 'link', contentUrl: 'https://www.facebook.com/', contentDescription: 'Facebook sharing is easy!' }; this.state = {shareLinkContent: shareLinkContent,}; }