I have data from redux called targetFarm. targetFarm.children contains these array object data. I want to put data in targetFarm.children into gyetong using useEffect and setgyeTong hooks. As an array object value like below But with my code it only takes one array. How can i fix my code? Answer For your information, you cannot the expected answer of gyetong
Tag: react-native
Why is my useEffect function called only once?
I am rendering a list of Trips objects inside a FlatList. So I have a screen named Network where I have FlatList which represents each of the trips. My render method: Inside my Trip component is the trip information. Trip’s name AND trip’s geo locations. From those geolocations I want to get the trip’s city and country. To do so
React native: Update value of object in array in state
I have a component which changes the state when checkbox is checked and the data needs to be updated of the object in the array. The component state looks something like this { key:1, todo:”Something”, isChecked:false } i have 3 files: AddTodo.js Which passes state & setState to an component TodoList which passes it the subcomponent TodoItem. I am unable
How to use inlineImageLeft in an Expo React Native project
So I was going through the React Native docs on <TextInput /> I saw a property called ‘inlineImageLeft’ and it seemed to add an icon on the left side of the <TextInput />. But in the docs, its specified that the icon should be stored in /android/app/src/main/res/drawable But I am using an Expo generated project. Is it possible to use
How to update nested object state in React
I have multiple checkbox svgs which i’m mapping over which removes the inner tick icon when I manually set either of the isSelected states to false. I want to remove/add the tick icon svg when I press the checkbox in my app. Im unsure where Im currently going wrong in my logic. It works correctly when I manually change the
How to simplify object
I have an issue here where the code is quite heavy and quite hard to read imo. I’ve simplified the code as much as I can but I was wandering if there’s a way to simplify this code even further? Or maybe if there is any better terminology i could use for the comments? Any help is much appreciated, Thanks
How to change Axios onDownloadProgress event.isTrusted = false to true in react-native
I’m using Axios “^0.27.2” for fetching data in react-native “0.62.2” and I’m trying to create a percentage loader using content-length which I’m getting from server in response header. API GET request code Above code is working fine I’m able to fetch data properly. but when I’m trying using onDownloadProgress progressEvent.loaded is coming -1 and also progressEvent.isTrusted=false console log of progressEvent
How can I change to horizontal alignment when using map in React native?
I have data called hello. If I have hello[0] data, I want to run hello.map and list the buttons. However, the Pressable component is vertically aligned, but I want to do it horizontally. So, I am trying to change the direction by giving a View on top of the map function. If i put a View, an Unexpected Token error
React Native call Odoo API via Axios struggling with CORS
I am using React Native, and trying to call Odoo APIs using Axios. This is how I successfully call authenticate on my local Odoo instance. Now that I got the result from Odoo. I want to call methods and query some records. So, I tried to get some records from DataSet search_read first. Here is what I tried. It gave
Why is my foreach and map return undefined [duplicate]
This question already has answers here: What does `return` keyword mean inside `forEach` function? [duplicate] (2 answers) Closed 22 days ago. I have a packet system where you can have products in a packet. So if anyone buy a packet I add this in shopping cart, if he buy it again then I check if the packet id is the