react-native-android

How To Reload View Tap on TabNavigator in React Native

半世苍凉 提交于 2019-12-13 15:09:31
问题 I want to reload the tabNavigator when the user changse the tab each time. the lifecycle method of react native doesn't get called when user changes the tab. Then how can it be possible to reload tab in TabNavigator : The below example have two Tabs : 1) Home 2)Events. Now I want to refresh the event Tab when user returns from the home tab. EXPO LINK : Expo Tab Navigator Code : import React, {Component} from 'react'; import {View, StyleSheet, Image, FlatList, ScrollView, Dimensions } from

'babelHelpers.asyncToGenerator is not a function' error

不羁的心 提交于 2019-12-13 09:00:11
问题 Expected Behavior App to load as it does on android. Actual Behavior Error: babelHelpers.asyncToGenerator is not a function Environment: OS: macOS Sierra 10.12.1 Node: 7.9.0 Yarn: 0.20.3 npm: 4.2.0 Watchman: 4.9.0 Xcode: Xcode 8.3.3 Build version 8E3004b Android Studio: 2.3 AI-162.4069837 回答1: Check your .babelrc file. Is it including the babel transform-async-to-generator plugin? If so, remove it. The babel helpers that React Native includes do not include the helper for that transform. I'm

React-navigation contentComponent is not working

心不动则不痛 提交于 2019-12-13 08:38:04
问题 I am trying to customize drawer navigator in my app. I am using react-navigation. When first time I've inserted this code it showed just white screen and even navigation links were disappeared after making few things it showed this error screen. Before that it showed just white screen inside drawer without my links. Here is the code. App.js import React from 'react'; import {StyleSheet, Text, View } from 'react-native'; import WelcomeScreen from './screens/WelcomeScreen'; import SigninScreen

How to get image height and width from uri on React Native?

泄露秘密 提交于 2019-12-13 08:09:50
问题 So, I tried to use function that provided by React Native which is Image.getSize. But when I try to use height and width outside the function it appears to be nil. Here is my code: var theHeight = 0; Image.getSize(url,(height, width)=>{ theHeight = height; }) console.log("test get height "+theHeight); and the result would be test get height 0 What did I do wrong? 回答1: There are two problems with your code. The first is that Image.getSize invokes its callbacks asynchronously. You need to put

How to pass data From one Scene to another in ReactNaive

旧巷老猫 提交于 2019-12-13 06:45:59
问题 My Question i have two Scene OnceScene and TwoScene I want to Navigate from OnceScene to TwoScene and at the same time i want to pass some array from 1st the 2nd so for that i have written the below code this.props.navigator.push({ id: "productdetails", passProps: {arr: arr[rowID]} }); you can see i am passing the array in passProps but how can i acess that array in TwoScene Its seems simple but since i am new i dont have much idea. 回答1: Have you tried using react-native router? https:/

Does load large amount of images in flatList hurt performance and how to avoid it

杀马特。学长 韩版系。学妹 提交于 2019-12-13 04:45:38
问题 ( just to note I don't want to use pagination I want to load very large list ) I am using flatlist to render about 5000 items. Each item reference photo like this ( not same photo just example ): 256 × 256 PNG 30,759 bytes (30 kilobytes) Or larger. When I go over 1000 items I start to experience performance issues. First is this realistic concern does image that is referenced from url go in to phone memory? Is there better way to reduce memory pressure when load this amount of images? I

Keyboard blocking textinput with Scrollview and KeyboardAvoidingView in react native

青春壹個敷衍的年華 提交于 2019-12-13 04:28:02
问题 I am using RN 0.55.4 + Expo I tried to use KeyboardAvoidingView to my form but it doesnt change anything with or without KeyboardAvoidingView , its still blocking my form. I am using tcomb-form This is my current code return ( <View style={styles.container}> <KeyboardAvoidingView> <ScrollView> <View> <Header/> <View style={styles.inputs}> <LoginForm formType={formType} form={this.props.auth.form} value={this.state.value} onChange={self.onChange.bind(self)}/> {passwordCheckbox} </View>

development server returned response error code 403 react native

非 Y 不嫁゛ 提交于 2019-12-13 03:47:20
问题 Iam using real android device connected using USB as emulator. When i run react-native run-android it is resulting in below error. The development server returned response error code: 403" Url: http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false ... when I use npm start it is stuck at React Package is ready Loading Dependency Graph done... Can you please help me out to resolve this. Thanks 来源: https://stackoverflow.com/questions/54143369/development

React native, React Navigation integration issue undefined is not an object getStateForAction

♀尐吖头ヾ 提交于 2019-12-13 03:11:03
问题 So I've been follow this tutorial and adapting for what I need. I've checked the other answer but can't quite make out what I'm missing? For the search engines, the error is: undefined is not an object, router, getStateForAction App.js import React, {Component} from 'react'; import {createStore, combineReducers, applyMiddleware} from 'redux' import {Provider, connect} from 'react-redux' import reducers from './reducers' import {View} from 'react-native' import ReduxNavigation from '.

Question: How can I design a header which is applicable for all devices in react-native

一曲冷凌霜 提交于 2019-12-13 02:59:17
问题 I need to design a header like below-attached image. Can I able to design this using react-native elements or material-ui. Here the profile name may be the lengthiest name or short name. But needs to work and start from that place. Can anyone suggest a good solution? Note: I have used react-native-elements (Header) but it not worked for me as expected 回答1: You can design completely custom Header with React navigation. By setting header height in navigationOptions import React from 'react';