天道酬勤,学无止境

react-native

Unable to resolve module `metro/src/lib/bundle-modules/HMRClient`

I just upgraded from RN 0.55.4 to 0.59.3.....now Im getting following error: Error: Unable to resolve module metro/src/lib/bundle-modules/HMRClient from ....\node_modules\react-native\Libraries\Utilities\HMRClient.js: Module metro/src/lib/bundle-modules/HMRClient does not exist in the Haste module map The HMRClient.js file does include the following require statement: const MetroHMRClient = require('metro/src/lib/bundle-modules/HMRClient');.....and I cant see that path beginning with 'metro' anywhere so I guess I need to add it somehow. There is also another require statement as follows: const

2022-01-19 02:36:10    分类:问答    react-native

React Native + Firebase Storage: base64 and blob not working

I'm trying to use to either encode my image file as base64 or blob, but neither of them are working. I'm also using this: https://github.com/react-community/react-native-image-picker to manage the image picker. Try 1: Using Image picker's .data method, which is supposed to return a base64 string const blah = uuid.v4(); firebase .storage() .ref('images') .child(`${blah}.jpg`) .putString(file.data, 'base64', { contentType: 'image/jpeg' }) But this throws: Firebase Storage: String does not match format 'base64': Invalid character found Try 2: Blob using https://github.com/wkh237/react-native

2022-01-19 01:50:10    分类:问答    firebase   react-native   firebase-storage

Firebase once() timeout

I am using Firebase once() method to retrieve a value in a React Native mobile app. Trouble is if the phone is offline, once() never returns. Documentation says that ref.off() method should cancel callbacks, but that doesn't seem to work. I'm guessing that off() doesn't apply to once() callbacks. If so how would I create a timeout?

2022-01-19 01:30:39    分类:问答    firebase   react-native   firebase-realtime-database

Detox - Enter on Numpad

I wonder how to enter the number using native keyboard and then enter it in just like typeText on a normal string on Detox using "\n" // await typeText('${screen_id}_screen_question_${question_id}_answer_input_', '\n'); How can I achieve this with number? Whenever I do the typeText ('n') it will give me GREYKeyboard: No known SHIFT key was found in the hierarchy.. In my assumption, because the numpad key doesn't have Enter key. But still not sure why it look for a Shift key. Thanks

2022-01-19 00:22:16    分类:问答    react-native   detox

Is it possible to customize default Sign Up, Sign In screens of aws-amplify-react-native package?

In order to have default auth screen, I can merely do this (https://github.com/aws-samples/aws-mobile-react-native-starter): import { withAuthenticator } from 'aws-amplify-react-native'; export default withAuthenticator(App); And I get pretty ugly default out-of-the-box login screen: Then docs say I can't modify default, I have to create my own (https://github.com/aws-samples/aws-mobile-react-native-starter): You can either use this Higher Order Component, or build your own UI and use the APIs from Amplify too. But also they thay say, that I can customize default login screens (https://github

2022-01-18 21:28:08    分类:问答    authentication   react-native   amazon-cognito   aws-amplify

why scrollbar resting on top in react native infinite scrolling using react-native-tab-view

I'm using react-native-tab-view in my App in which I have 2 tabs. I am loading Tab data via API call for creating infinite scroll pagination in side Tab, when data is concatenating in my FlatList data from API then each time my scroll bar reset to top position. I currently have snack demo like so: https://snack.expo.io/@luckyamit/9905d4 I don't want to reset my scroll bar on top in each API call i have search a lot for this issue but not find my solution. can any one help me to resolve my problem ?

2022-01-18 20:18:28    分类:问答    reactjs   react-native   infinite-scroll   react-native-flatlist   react-native-tab-view

Change placeholder font style on native-base

I use native base Input Component, and I tried to customize the placeholder font style like the following example, but it does not change the placeholder. It changed the style of the user typed input value. How can I change the placeholder font style? <Input style={{color:"blue", fontFamily:"Arial"}} placeholder="I am blue and Arial font" /> Update I already tried placeholderStyle like the following example, but it does not work. <Input placeholderStyle={{color:"blue", fontFamily:"Arial"}} placeholder="I am blue and Arial font" />

2022-01-18 18:25:05    分类:问答    reactjs   react-native   native-base

how to show "DONE" button above "number-pad" keyboard? using react-native

can any one tell me that how to show "DONE" button above "number-pad" keyboard, that i want like this any help much appreciated

2022-01-18 18:05:03    分类:问答    react-native

undefined is not an object(evaluating ImagePickerManager.showImagePicker)

var ImagePicker = require('react-native-image-picker'); call() { var options = { title: 'Select Avatar', customButtons: [ {name: 'fb', title: 'Choose Photo from Facebook'}, ], storageOptions: { skipBackup: true, path: 'images' } }; ImagePicker.showImagePicker(options, (response) => { console.log('Response = ', response); if (response.didCancel) { console.log('User cancelled image picker'); } else if (response.error) { console.log('ImagePicker Error: ', response.error); } else if (response.customButton) { console.log('User tapped custom button: ', response.customButton); } else { let source = {

2022-01-18 13:43:44    分类:问答    react-native

TextInput not working as expected when programmatically entering text

The below code does not work properly in iOS (iPhone 6). When I press ‘Push Me’, the word is not displayed completely and the cursor is also not shown. On further investigation, I found out that onChangeText and onContentSize change are not triggered. Pressing any key on the key board after pressing the ‘Push Me’ button displays the full word. I want the full word to be displayed when the button is clicked. It works, if I use value prop to update the TextInput. But I need to display formatted text like in the ‘TokenizedTextExample’ in this link: https://facebook.github.io/react-native/docs

2022-01-18 12:34:45    分类:问答    react-native   textinput   react-native-ios