Skip to main content

All Questions

-1 votes
1 answer
56 views

Updating value inside nested object of object in React Native

I have state set as follow const [stories, setStories] = useState([]); I fetch Data from API in array, and i map the array and set the using setStories as: setStories(prevState => prevState.concat(...
Anwer Solangi's user avatar
0 votes
2 answers
2k views

spread operator not working in react native

'browsed' is an array of objects with data for each letter: [ { allowMultiSign: undefined, allowSingleSign: "1", assignmentStatus: "Browsed", disclaimer: null, ...
cDub's user avatar
  • 518
0 votes
1 answer
28 views

improve setState with TextInput or Pickers in React & ReactNative & ES6

This code is currently working, but I don't know if there is a way to do it better, or at least more reusable. I am working with reactNative but maybe this is more an ES6 question. The State: ...
ValRob's user avatar
  • 2,544
-1 votes
3 answers
1k views

'Can't find variable: clicks' in react-native

The following code shows an error when clicked on the 'Click Me!' button saying that the variable 'clicks' cannot be found whereas it is properly mentioned in the state import { StyleSheet, Alert, ...
Taher Lunawadi's user avatar
2 votes
5 answers
148 views

Javascript Object to array then remove element

I have this object Object { "87291": "valid", "1873681927": "valid", "nwq89j8jw0qj9": "valid", "oVFYfWIUOsONE6JyMGYAbnsPMAr1": "valid", } what i want to do is remove object based on key ...
Sandy Smarue's user avatar
6 votes
3 answers
3k views

Object.fromEntries only available on iOS? (react native - NOT WEB)

The title is pretty self explanatory but still, consider this sample code: import * as React from 'react'; import { Text, View, StyleSheet } from 'react-native'; import { Constants } from 'expo'; ...
iuliu.net's user avatar
  • 6,995
0 votes
2 answers
37 views

Fetching data from function into <View> component inside the render method

I tried to fetch the data from function inside render, when I use alert() it works, but when I try to return real text it not shown any thing the code I work with: export default class App extends ...
zippax's user avatar
  • 304
0 votes
3 answers
621 views

Displaying markers from React Native Maps using forEach

I have this array in my state: coinCoordinatesArray: [ { latitude: 37.78825, longitude: -122.4324}, { latitude: 38.78825, longitude: -120.4324}, ...
dclipca's user avatar
  • 1,927
-1 votes
3 answers
472 views

What is { xyz } = Object, where Object have xyz as property [duplicate]

What is { XYZ } = Object called ? where Object have xyz as property.
iksheth's user avatar
  • 144
2 votes
4 answers
3k views

How to get the sum of children values of an object in a Javascript react native?

Here is my object: var obj = { "idtransact1": { "amount": 3000, }, "idtransact2": { "amount": 3000, } } I am trying to get the sum of all amount. I tried to adapt this example ...
Tax Raoul's user avatar
1 vote
0 answers
26 views

Assigning alias to object passed as parameter to function in Javascript [duplicate]

In this function I have this object { email, password } passed to it static login = ({ email, password }) => { const body = { email, password }; callApi(body); } So to access the ...
Daniyal Awan's user avatar
1 vote
1 answer
57 views

How to modify a specific element of a nested object using ES6?

I have this initialStore: const initialState = { 0:{ screen_name: '1', props: null, }, 1:{ screen_name: '2', props: null, }, 2:{ screen_name: '3', props: null, }, ...
Luis Rizo's user avatar
  • 2,109