Questions tagged [react-native]

React Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere.

0
votes
0answers
3 views

How to execute some event if RN has been killed?

Not sure if I understand correctly but according to this link Deliver silent notifications and wake up your app in the background on the user's device. It sounded to me that it's possible to ...
0
votes
0answers
10 views

AsyncStorage.getItem in react native not working

I'm setting data from server as AsyncStorage.setItem and trying to access that value in another screen using AsyncStorage.getItem. 1. I can't set the token within AsyncStorage. 2. How do I set ...
0
votes
0answers
3 views

how 2 resolve last.fm authentication problem

**Guys pls help i get the session key from mobileSession but i i use it with track.love method i get Invalid method signature supplied ** here is my code: export const trackLove = (track, ...
1
vote
1answer
356 views

React Native - [Gradle] Could not find aapt2-proto.jar

See below error for the issues. Also see this link (as I suspected) has the POM file and no jar Important Notes: I am using latest version of react native ... v0.57.3 and also latest version of ...
0
votes
0answers
7 views

[bitcore.ErrorInvalidArgument: Invalid Argument: Must provide an object from where to extract data]

W/ReactNativeJS(21325): Possible Unhandled Promise Rejection (id: 0): W/ReactNativeJS(21325): [bitcore.ErrorInvalidArgument: Invalid Argument: Must provide an object from where to extract data] how ...
-1
votes
2answers
29 views

Why use push function make the array become to number?

I click my <CheckBox /> will send the id and I use the code: this.setState({ ids: ids.push(id) }); make my this.state.ids become an ids array. Click first time looks very well that is an ...
0
votes
0answers
8 views

How to detect pinch gesture in ScrollView in React-native?

I'm using scrollView like this <ScrollView style={{flex:1}}> <Text /> <Some components /> <Webview /> </ScrollView> And Webview has height and can scroll too. ...
0
votes
0answers
16 views

Show downloading progress progress in react-native?

Want to block the screen and show downloading progress box like gmail file downloading functionality using react-native-modal or any other way. Using react-native-fetch-blob for downloading files. ...
0
votes
0answers
10 views

react native listview with conditon

i want to use conditon with if inside listview in react native,my code is : i change if..else with ?: condition but i can not show my condition inside list and show if and else with toghether. ...
0
votes
0answers
7 views

Mocking file import with Jest

I am trying to create unit tests in a legacy project we are working on. Configuration is being imported into modules, but I would like to mock this whole import. Setup is like this: In .eslintrc "...
0
votes
2answers
18 views

How to close modal and return value from flatlist when click on item in react native?

I am creating country codes class. In which, I return list of country codes. I want to close modal that contains of list codes and also return the clicked item value of flat list that display list of ...
0
votes
0answers
17 views

Unable to observe node (update not receiving) in firebase

I am creating a chat listing with react native and firebase. My firebase database is like this. I am able to list the chats but it is not updating when a new chat adds or when I send a new message in ...
0
votes
1answer
15 views

How to download a file (image,gif,etc..) in react native

I have tried this code but my app is crashing without showing any error , i couldnt figure out what is the error const {config,fs} = RNFetchBlob; const { params } = this.props.navigation.state; let ...
0
votes
0answers
5 views

React native partial modals with pan responder

I'm trying to recreate an element that appears over the screen and that can be expanded, closed or resized by a scroll gesture. I don't know the real name of this element but it can be found in Apple ...
0
votes
1answer
16 views

what is the correct way to use promise in AsyncStorage.getItem method?

I've been trying to get the value in the AsyncStorage using getItem() method. I've created one switch navigator. which is as follows. export const AuthNavigator = createSwitchNavigator( { ...
0
votes
0answers
5 views

marginTop interpolation does not render on screen

I have an interpolation function that I call with the intention to change a margin from 25 to 100 const marginTop = this.loginHeight.interpolate({ inputRange: [220, SCREEN_HEIGHT], outputRange: [...
0
votes
1answer
13 views

React-Native Switch color of long press shadow

I'm developing an application with react-native version 0.57. I'm using Switch for switch button. I used its props for customizing it, but the color of long press shadow is green and I don't know how ...
0
votes
1answer
14 views

React-Native Native module cannot be null after adding Webviews

I am trying to add React-Native Webview in my existing iOS app, but getting issue Native Module cannot be null. I have tried lot of solutions from online community but yet not fixed the issue. 'use ...
0
votes
2answers
27 views

Adjust font size based on screen size of smartphone React native

Hey guys im using const {width,height} = Dimensions.get('window'); to adjust my font based on screen width size. using like this.... fontSize:width/24 its looks good in iPhone and android device ...
0
votes
0answers
18 views

Receive callback when an action updates view

Just as in react native setState method we can pass a callback to be called whenever the state updates the view. What is the similar callback for an action when it updates view. I want receive a ...
1
vote
0answers
22 views

React Native - Request Location in android 7, 7.1 dont work, return timeout

I have worked in Project relate to Location. static currentLocation(myLocationCallback) { try { navigator.geolocation.getCurrentPosition( (location) => { if (this....
0
votes
0answers
8 views

Overlay permissions needs to be granted in order for react native apps to run in dev mode

Screen_Shot i just updated my app targetSdkVersion 22 to 26, then i got the 'overlay permissions needs to be granted in order for react native apps to run in dev mode' when i built the application. ...
0
votes
2answers
16 views

A better way to change the background color using a ternary operator

Currently, I'm using a function to to toggle hasBeenClicked, then I use a conditional to make sure the background color is changed only when hasBeenClicked is true. I'd prefer to use a ternary ...
0
votes
1answer
20 views

Mapping over second array in JSX

I am currently mapping over some data in order to render 4 dots on a status bar in the JSX in React Native. However, I have a second array that I would like to map over, so that each date appears ...
0
votes
1answer
22 views

Programmatically importing local json file react-native

I have a hand full of json objects I need to load into a react native app. I couldn't find much documentation on how import sample from '../data/Sample.json'; imports. I will only need to load 1 file ...
0
votes
0answers
5 views

React Native bundle integrity with OTA

When one OTA the js bundle inside a react native app (via CodePush or similar), how does one ensure the bundle is intact? with App Store or Google Play, the app / apk file is signed, thus ensuring ...
0
votes
0answers
4 views

React Native Listview Firebase Database getting object and displaying question

The code below is a code that I copied from Github to study. export default class App extends Component { constructor(props){ super(props) const ds = new ListView....
0
votes
0answers
19 views

why does FlatList keep loading forever?

I am using FlatList to write an infinite scroll, but it keeps sending request to my server forever. please see the code blow. I don't find any article clarify when the next page will load, what ...
-1
votes
0answers
9 views

What is the good library for HTML View in React-Native?

I'm wondering what is good library for HTML View. I want to implement like a gmail's HTML content. have Zoom in and out and scroll smoothly well. (+) I tried using WebView from React-native Component. ...
0
votes
0answers
9 views

App stuck at touch press react native [Android]

react-native app hangs at any touch event. The button(TouchableOpacity/View) has only a console log inside the onPress cb function. This issue only arise on android, but ios works fine. This problem ...
0
votes
0answers
9 views

React Native TopLevelNavigator NavigationActions not passing Prams

I a top level navigation service following the information in the docs https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html The navigation works but doesn't send the prams ...
2
votes
1answer
15 views

Iphone 5 status bar is being covered React Native

My code works fine on Most of iPhones but on Iphone 5 the status bar has been covered by the view, I don't know how to margin the view in Iphone 5 only if i used margin top in the view, it looks weird ...
0
votes
1answer
11 views

Rendering a React Native Image Dynamically in a map function with external links

let result = this.state.yards.map( yard=> { return <View><Text style={{color:'black'}}><Text style= {{color:'darkslateblue', fontSize:18}}>{yard.name}</Text>{"\n"}{...
0
votes
0answers
9 views

reat-native-web electron content incorrect

I've been trying to get react-native-web to play nice with electron but I'm having a couple of issues, namely the content is being partially hidden behind the top menu bar and the light blue ...
0
votes
0answers
17 views

Different errors in react-native

I permanently get different errors in my react-native app. Sometimes the application starts up normally, sometimes I get this: The same code may or may not be launched. Restarting "Expo" on the ...
0
votes
0answers
8 views

Imitate react-native-maps but with custom map image

Is there a simple way to have the functionality of a MapView (the ability to place markers, zoom, and pan around a given map) but with a custom image instead of the world map in react-native? If not, ...
0
votes
0answers
9 views

Undo shake in TextInput react-native (Expo)

It doesn't work by default in Expo. I didn't find any docs about it in Expo and in react-native documentation. I tried to publish project in product mode for disabling react-native debug menu by ...
0
votes
1answer
13 views

React-Native and Redux: How to reuse reducer to handle multiple component

I am not sure whether I understood redux and react native. I am currently writing an app required to fetch data from server. I have one login reducer, two different function to fetch a set of ...
0
votes
1answer
10 views

What does the accessibilityLabel property do in react native?

I am learning to react native and found the accessibilityLabel property in the Button component. Can anyone tell what does the accessibilityLabel property do in android? Thanks !!!
-1
votes
0answers
23 views

Authentication failing in react native app

I am pretty new to react native and I am using firebase to implement authentication in my app. However despite putting the correct email and password I am failing to log in. It is always showing ...
0
votes
2answers
15 views

React Native - Axios - Trying to upload image

I am new to React Native and trying to upload Image with Axios but getting: Request failed with status code 500 I don't have backend problem because I can upload image with postman and everything is ...
0
votes
0answers
17 views

How to generate mnemonics in React Native?

I want to generate mnemonics in React Native. I have cloned this project. I imported bip39 but I am getting this error in mobile/simulator. Works fine in debug mode in Chrome browser. library Error:...
0
votes
0answers
7 views

React-Native-Wifi connectToProtectedSSID fail to conect

I am trying to use the connectToProtectedSSID function and I always get the connection failed alert on my android phone. I am able to get the wifi list, the current SSID, etc... Could I be missing ...
0
votes
1answer
27 views

How do I manage data for a Point Of Sales Android app written in react-native

I am making a react-native POS application on Android. I am storing data(items, employees, etc.) in an online MySQL database. I also need to sync orders across all POS's of a restaurant. The ...
0
votes
0answers
8 views

React Native Expo ImagePicker customize

Is there a way please to customize to the Expo ImagePicker and change the titles, labels, languages etc etc My first investigations showed that apparently it is not possible. Do you confirm? If it is ...
0
votes
1answer
128 views

react native java.lang.RuntimeException: No server to serve request

I was just getting started with react native and I encountered some problem while building the app. Here's the error: (Complete log) Starting JS server... Building and installing the app on the ...
0
votes
1answer
12 views

React Native - text disappearing on custom component style change

Getting a strange error when trying to apply conditional styling to a custom component. Whenever the style change should appear the text completely disappears. If I start typing again, the new styling ...
0
votes
1answer
21 views

react Native request failed with 415

I am using react native and I want to send some document file to server using patch request. This is the form data which I am sending Below is the fetch code export const stepStageFour = (data,id) ...
0
votes
1answer
19 views

Set correct variable in picker depending chosen value

I'm a newbie in react native. Currently what I'm trying to achieve is the following: My application contains 2 pickers: 1 for places to eat and the other for the menu's The "Eating places" picker ...
0
votes
0answers
11 views

How to update push notification when app is in the background (React native )

componentDidMount() { PushNotificationIOS.cancelAllLocalNotifications(); PushNotificationIOS.addEventListener('localNotification', this._onNotification); PushNotificationIOS....