Skip to content
Advertisement

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

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

Advertisement