2018-10-21         Catherine

React Native - setState from array

I'm trying create-react-native-app for the first time and I want to change text on varying time intervals. But my code only gives me the last item of the array.import React from 'react';import { Text } from 'react-native';const blinkText = [ { text: "A", time: 500, }, { text: "B", time: 1000, }, { text: "C", time: 1000, }, ];export default class App extends React.Component { constructor(props) { super(props); this.state = {}; } componentDidMount() { this.interval = setInterval(() => { blinkText.map(value => this.setState(value...

 react-native                     1 answers                     33 view
 2018-10-22         Michaelia

Pass function in react native prop

I currently have a screen that lists items with star ratings on them.This is created due to the following JSX being returned by a _renderItem function for a FlatList component. : <TouchableOpacity delayPressIn={70} activeOpacity={0.8} onPress={() => { navigate("WellbeingBreakdown", { id: info.item.id, }); }} > <RkCard rkType="horizontal" style={styles.card}> <Image rkCardImg source={info.item.icon} /> <View rkCardContent> <RkText rkType="small">{info.item.title}{' '}&...

 react-native                     1 answers                     10 view
 2018-10-22         Stephanie

Show Hyperlinks in React Native Alert?

I want to use the Alert Api to display OS behavior alerts.I'm asking myself if you can display Hyperlinks inside the Text of an alert?Alert.alert( 'Alert', 'This is an Alert. I want to include hyperlinks here.', [ { text: 'Cancel', onPress: () => console.log("Alert cancel"), style: 'cancel', }, { text: 'Accept', onPress: () => console.log("Alert accept"), style: 'default' }, ]); Much better to create a Modal (or simply a View component with position: absolut...

 react-native                     3 answers                     74 view
 2018-10-22         Carl

Android ScrollView ignores its border (Screenshots attached)

Trying to set border to ScrollView component. On iOS it works just fine, but not on Android: scrollView: { borderColor: '#000000', borderStyle: 'solid', borderWidth: (1), }Nice black border on iOS:No black border on Android:Try here: https://rnplay.org/apps/cJbAjg Can't really explain why, but one of the fixes is the following:var styles = StyleSheet.create({ container: { marginTop: 20, marginHorizontal: 1, borderRadius: 8, borderColor: 'black', borderStyle: 'solid', borderWidth: 1, }, scrollView: { height: 40, }, ...

 react-native                     1 answers                     46 view
 2018-10-22         Dora

Not able to get Relay work with React Native

I'm trying to setup a basic React Native Relay project. I'm creating this issue after spending ample of time trying debug the problem without any luck. I'm getting this warning on console and my react native app is not able to make calls to GraphQL server. Warning: RelayNetworkLayer: Call received to injectImplementation(), but a layer was already injected.Running application "ExampleApp" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFFfetchWithRetries(): Still no successful response after...

 react-native                     2 answers                     52 view
 2018-10-22         Julius

react native how run code if uninstall app

Is there a way to run code (for example call an api to delete some data automatically) if I delete the app?To be more specific, to make a call to an api to delete push information if the user delete the app without loging out According to this post comment: Sorry, this is not possible. It's not a limitation of React Native - neither Apple or Google give you this metric. You can track your app install numbers in Google Analytics and iTunes Connect, but I believe neither will give you a simple answer either. [XXX]

 react-native                     1 answers                     89 view
 2018-10-22         Angelo

adb.exe does not exist react native

while runing react native giving error File 'C:\Users\inbox\AppData\Local\Android\platform-tools\adb.exe' specified for property 'adbExe' does not exist. while adb.exe exist in path C:\Users\inbox\AppData\Local\Android\Sdk\platform-toolswhat is the solution for above problem? May be you forgot to add path of adb in SystemsVariable so add adb path Here is the guide for How to Add Adb path [XXX]

 react-native                     1 answers                     97 view
 2018-10-22         Hermosa

React Native: ignore files in a CodePush update

My use case is that I have an env file and its contents are replaced each time I build the app through Appcenter with environment variables. I fear that when I update the file locally (for example add another variable), the file would be overwritten in next CodePush release (so basically the build from Appcenter after the vars are replaced will have different contents of this file in comparison with what CodePush will see). Is this the correct assumption? If it is, is there a way to exclude certain files from a CodePush update? Thanks. I'm using react-native-config, and ...

 react-native                     1 answers                     95 view
 2018-10-22         Karen

How can i hide first Picker Item of Picker in React Native?

This is my sample code, in Android I cant select first Picker Item at first time, i have created one dummy item so i need to hide first field.<Picker selectedValue={ this.state.selectedValue } onValueChange={(item) => this.setState({selectedValue: item})}> <Picker.Item label={"Slect Any"} value={null} /> <Picker.Item label={"item1"} value={'item1'} key={key} /> <Picker.Item label={"item2"} value={'item2'} key={key} /> <Picker.Item label={"item3"} value={'item3'} key={key} /></Picker>Any one help this. You can have...

 react-native                     2 answers                     66 view
 2018-10-22         Archibald

what are core concept of sectionView, ListView and FlatList?

I'm very new to react-native. I want to know what are the core differences among SectionView, ListView and FlatView in react-native? And what cases I should use them. ListView (Deprecated)It is an deprecated class which was used to create List. You can also read List documentation. DEPRECATED - use one of the new list components, such as FlatList or SectionList<ListView dataSource={this.state.dataSource} renderRow={(rowData) => <Text>{rowData}</Text>}/>FlatListNow you should use this class to create Lists. Its performance is better than ListView...

 react-native                     1 answers                     18 view
 2018-10-22         Oscar

How to know if the user update/installed the app?

I have a question...can I know if the user updated or installed the app? I'm trying to send to the server the new device token every time the user is updating or installing again the app. If theres a way where would you recommend to add it?(in app.js?)Thank you You can use the react-native-device-info package to get the current application version.import DeviceInfo from 'react-native-device-info';const version = DeviceInfo.getVersion();// iOS: "1.0" here 1.0 is your current application version.// Android: "1.0"react-native-device-infoYou can call this in your app.js. S...

 react-native                     1 answers                     22 view
 2018-10-22         Vita

react-native run-android not working on ubuntu 16.04

i have a problem with react native in ubuntu, i have installed,java jdk 8 (both javac --version) as well as echo $JAVA_HOME gives the proper output.I have also installed android studio and set the android environment variables as well as the tools and echo $ANDROID_HOME gives output of the sdk location.I have also installed gradle version 4.4.I am unable to start the android app using react-native run-android. can any one let me know if i have missed something during installation.And react-native as well as android studio works fine as I am currently using react-native star...

 react-native                     1 answers                     26 view
 2018-10-22         Christine

Best video player for play video in react native

*react-native videoI tried this and in some android mobile phones its not working.ISO works fine.*react-native af-playerI tried this one and in its works fine with android.IOS gives "videohas no proptype" error its seems wont work in IOS platform *I tried to switch the players by detecting the mobile platform, couldn't do due af-player create based on react-native video so only one can use.Can anyone suggest a good video player for react native.react-native": "0.54.2react-native-af-video-player": "0.2.1react-native-video": "3.1.0Many Thanks!! Try using https://www.npmjs....

 react-native                     2 answers                     28 view
 2018-10-22         Rudolf

React-native componentWillMount not calling

I am new in react-native I have two screens in my stack. Login and Home.I want to go back to login from a button on home.I am writing this codethis.props.navigation.navigate('loginScreen')but in login screen componentWillMount method is not calling. I want to reset my form when user come on login screen from home.Can anyone help me here?Thanks in advance. To go back from login from home , you should use this.props.navigation.goBack() if the screen is immidiately before home.Secondly, you should not use componentWillMount since it is deprecated and will be removed from Re...

 react-native                     3 answers                     28 view
 2018-10-22         Paula

View over another view in percentage of screen width

I am new in react native and i want a view like attached image. I have no idea that how can achieved this..? I have tried this:app.js <View style={styles.navSectionStyle}> <TouchableOpacity style={styles.SubmitButtonStyle} activeOpacity = { .5 } onPress={ this.ButtonClickCheckFunction }> <Text style={styles.TextStyle}> Page 1 </Text> </TouchableOpacity> <View style={styles.BackStyle}> <Text style={styles.Te...

 react-native                     1 answers                     30 view
 2018-10-22         Burnell

How to setup remote notifications without certificate? (RN)

I want to test some remote notification services in React Native. But run into some problem. In iOS I need to enable the Push Notifications BUT for that I need a Developer Plan. For testing and playing around of course I do not want to buy an iPhone Developer Program.Is there a way to test remote push notifications without the need of buying iPhone Developer Program? No, a paid Apple Developer Program membership is required to use push notifications. [XXX]

 react-native                     1 answers                     30 view

Page 1 of 172  |  Show More Pages:  Top Prev Next Last