react-native-android

React' findNodeHandle method stopped working

江枫思渺然 提交于 2019-12-09 14:21:49
问题 After upgrade to 0.26.0-rc version, this line: React.findNodeHandle(this.refs.myRef) Throws this error message: Unhandled JS Exception: _react2.default.findNodeHandle is not a function. I'm importing React with this: import React from 'react'; Docs still say: "As always, to obtain a native node handle for a component, you can use React.findNodeHandle(component)." 回答1: Now the function may be used without object: import { ... findNodeHandle, ... } from 'react-native'; And call it directly:

React-Native FlatList performance problems with large list

懵懂的女人 提交于 2019-12-09 09:53:08
问题 My code gets Json data to an array lists the data using a FlatList . It looks like a phonebook photo and text in a row. Here is My code: renderItem = ({ item }) => ( <ListItem title={item.username} avatar={{ uri: item.photo }} /> ) render() { console.log(this.state.myData); return ( <View style={styles.container}> <FlatList data={this.state.myData} renderItem={this.renderItem} /> </View> ); } Its works and I get the output, but the performance is slow. Rendering takes approximately 10 seconds

Cannot run adb shell “date `date +%m%d%H%M%Y.%S`”

落花浮王杯 提交于 2019-12-09 07:49:53
问题 I have a warning when running React Native on an Android device: Debugger and device times had drifted by more than 60s. Please correct this by running adb shell "date `date +%m%d%H%M%Y.%S`" on your debugger machine But when I run the command as suggested above, I get and operation not permitted error: date: cannot set date: Operation not permitted I already tried with sudo, still got same result: sudo adb shell "date `date +%m%d%H%M%Y.%S`" 回答1: Inside the emulator goto Settings > Date & Time

how to upload image or pdf file with form-data in react-native?

为君一笑 提交于 2019-12-08 11:29:23
问题 i found some libraries but i am not sure which one is suitable and stable for me. i am implementing like email attachment with form-data. Choose uploading files from gallery or file Manage on Android device and upload to server. could you recommend nice library? thank you ! what i have found https://github.com/kaancelen/react-native-nononsense-file-picker https://github.com/Elyx0/react-native-document-picker https://github.com/farmisen/react-native-file-uploader https://github.com/huangzuizui

TypeError - null is not an object (evaluating 't.data') [React Native 0.59.5 Android]

浪尽此生 提交于 2019-12-08 10:54:02
问题 After updating my React Native application to 0.59.5, I am seeing several people are crashing in random places for Android users (iOS users are fine). I am using Sentry to track the crash places and the error says: TypeError readAsText(react-native/Libraries/Blob/FileReader) Following is the stack reported in Sentry dashboard. When I check BREADCRUMBS, I see the following. I am using fetch for HTTP calls. Has anyone faced this problem before? Our API is returning fine. The issue is happening

React-native Airbnb-Maps: How do I render a button inside the airbnb maps pop-up box?

前提是你 提交于 2019-12-08 07:20:28
I am trying to render a button which I can use to redirect to another page within the description page (the pop-up-box if you select a marker) using AirBnb maps (using MapView.Markers ). I am not sure how to achieve this. Currently my markers look as follow: const markers = [{ longitude: 8.545592, latitude: 47.366465, description: "Bike 1", title: "Bike 1" }, { longitude: 8.545892, latitude: 47.366365, description: "Bike 2", title: "Bike 2" } ]; Whenever I try to input JSX into a text, I get a NSMutableDictionary cannot be converted to NSString error. (When I do this: const markers = [{

React-native use react-native-vector-icons in android module

≯℡__Kan透↙ 提交于 2019-12-08 03:45:11
问题 I'm writing a module for react-native that should run on android, I have to do so to take a react-native-vector-icons and switch it to the module to be able to use them as a Drawable image. To use the type of icons: FontAwesome, Entypo, Ionicons, MaterialIcons and etc. I found something like that, but I did not understand how it works or how to make it work in my case. Link: here @TargetApi(21) private Drawable generateVectorIcon(ReadableMap icon) { StrictMode.ThreadPolicy policy = new

Enable Popups in React Native WebView

断了今生、忘了曾经 提交于 2019-12-08 02:41:26
问题 I have a react native application(using react-native 0.43.3) that uses webview to show a web page used for online banking. That site loads a popup window with the login page. With the ReactNative WebView this popup window in not shown. In native android to enable popup window showing I found out that I need to make webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true) , but couldn't found a way to set this parameter when using ReactNative WebView. Is there a way which I can

multi threading in react-native

偶尔善良 提交于 2019-12-08 02:29:26
问题 I have a React-Native application and I want to use parallel programming (I want to use all of the cores of the tablet). I tried paralleljs and hamsters.js libraries but they were not useful. One doesn't support RN and the other has some issues with Blobs at the moment. So, I decided to use web-workers. After doing some search on it (from MDN etc), I realized that I might use web workers alone instead of all these libraries. However I can't be 100% sure about it. There are other libraries

What is the real world example of real DOM and virtual DOM in React?

和自甴很熟 提交于 2019-12-07 21:24:18
问题 If someone asks for the example of Real DOM and Virtual DOM, may be programmatically? How can this be explained? 回答1: Normal DOM Manipulation If one of these list items updates, then the DOM re-renders the entire list. This is where the DOM’s inefficiency stems from. This is inefficient because it requires traversing every single node recursively. Virtual DOM Since the data is saved on the state, components can simply listen to events on the state and if there is an update, it can re-render