react-native

react-native-contacts returns undefined

怎甘沉沦 提交于 2021-02-09 10:50:47
问题 I'm tryna get the contacts list of the device but react-native-contacts returns undefined. I've Installed the package and linked it as mentioned in the project's GitHub page https://github.com/rt2zz/react-native-contacts I've also added the permissions to the android-manifest file. How do I get it works 回答1: This happens mostly because of the linking-step was missing as there are native modules required: After npm install react-native-contacts (or yarn add ) you are required to link the stuff

URL.createObjectURL does not work in react-native, Is there an alternative to create a url?

白昼怎懂夜的黑 提交于 2021-02-09 09:21:47
问题 I am trying to display pdf file in react-native app. Here is my code: getting blob from api : Blob { "_data": Object { "blobId": "85225e45-7f45-463b-bd62-a9170551a3b7", "lastModified": undefined, "offset": 0, "size": 3028, "type": "application/pdf", }, } Note: After converting to base64Data i am able to render images but not pdf files. const fileReaderInstance = new FileReader(); fileReaderInstance.readAsDataURL(response.data); fileReaderInstance.onload = () => { base64data =

URL.createObjectURL does not work in react-native, Is there an alternative to create a url?

Deadly 提交于 2021-02-09 09:21:30
问题 I am trying to display pdf file in react-native app. Here is my code: getting blob from api : Blob { "_data": Object { "blobId": "85225e45-7f45-463b-bd62-a9170551a3b7", "lastModified": undefined, "offset": 0, "size": 3028, "type": "application/pdf", }, } Note: After converting to base64Data i am able to render images but not pdf files. const fileReaderInstance = new FileReader(); fileReaderInstance.readAsDataURL(response.data); fileReaderInstance.onload = () => { base64data =

URL.createObjectURL does not work in react-native, Is there an alternative to create a url?

北慕城南 提交于 2021-02-09 09:19:18
问题 I am trying to display pdf file in react-native app. Here is my code: getting blob from api : Blob { "_data": Object { "blobId": "85225e45-7f45-463b-bd62-a9170551a3b7", "lastModified": undefined, "offset": 0, "size": 3028, "type": "application/pdf", }, } Note: After converting to base64Data i am able to render images but not pdf files. const fileReaderInstance = new FileReader(); fileReaderInstance.readAsDataURL(response.data); fileReaderInstance.onload = () => { base64data =

Formik Validation for Native Base Input

五迷三道 提交于 2021-02-09 03:00:42
问题 I am using native base's input field and am trying to validate it using Formik and Yup. However, no validation is happening so far. It doesn't show any errors even if I type alphabets. This code works (without Formik): type EmailRegistrationProps = {}; interface FormValues { friendEmail: string; } type AddFriendEmailPageProps = { toggleShowPage: () => void; showAddFriendEmailPage: boolean; }; export const AddFriendEmailPage: React.FunctionComponent<AddFriendEmailPageProps> = ({ toggleShowPage

Formik Validation for Native Base Input

微笑、不失礼 提交于 2021-02-09 02:57:17
问题 I am using native base's input field and am trying to validate it using Formik and Yup. However, no validation is happening so far. It doesn't show any errors even if I type alphabets. This code works (without Formik): type EmailRegistrationProps = {}; interface FormValues { friendEmail: string; } type AddFriendEmailPageProps = { toggleShowPage: () => void; showAddFriendEmailPage: boolean; }; export const AddFriendEmailPage: React.FunctionComponent<AddFriendEmailPageProps> = ({ toggleShowPage

Exception in HostObject::get(propName:RNfirebase)

痴心易碎 提交于 2021-02-08 23:36:53
问题 I am learning how to implement Firestore with react-native(Android). Then, I found 'react-native-firebase' and stuck in this exception. Error:Exception in HostObject::get(propName:RNFirebase): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/FirebaseApp; I already setup firebase in my gradle (ref.https://firebase.google.com/docs/android/setup/?authuser=0) Firebase database's rule rules_version = '2'; service cloud.firestore { match /databases/{database}/documents {

react native android/app/build.gradle file missing

百般思念 提交于 2021-02-08 20:54:14
问题 I'm new to react native and I would like to create a simple app working with firebase push notifications. So I've created my react app using 'expo init' Now I'm stuck at point 2 of this tutorial https://github.com/invertase/react-native-firebase-docs/blob/master/docs/installation/android.md In the tutorial, it says "apply xyz to your android/app/build.gradle" but the problem is that I have no such file, also in many other tutorials of react native this file is mentioned... do I have to create

Running Expo in development offline

 ̄綄美尐妖づ 提交于 2021-02-08 20:47:34
问题 I looked over the docs, but cannot find a way to run Expo completely offline. I'm frequently in an area without a stable connection and this makes it exceptionally difficult to maintain a proper work flow. I would have thought that exp start --dev --lan would enable offline development, but my expo client still fails on inability to connect to the expo servers. Is there a truly offline mode for expo? 回答1: With the latest version of Expo (v32) you can run offline by using the following command

Must use destructuring props assignment [duplicate]

两盒软妹~` 提交于 2021-02-08 19:44:13
问题 This question already has an answer here : Must use destructuring props assignment (react/destructuring-assignment) (1 answer) Closed last month . I'm using Eslint in my React Native project, and in this code: export default class AuthLoadingScreen extends React.Component { constructor() { super(); this.bootstrapAsync(); } bootstrapAsync = async () => { const userToken = await AsyncStorage.getItem('userToken'); this.props.navigation.navigate(userToken ? 'App' : 'Auth'); }; render() { return (