I would like to implement scrolling to top. My tab is a flatlist, and when users scroll down the flatlist, they have to scroll back up. Instagram and Twitter allow you to press the tab to scroll back up, I am wondering how to implement it in my own app. Here is the tab I want to implement scrolling to
Tag: react-native
Hook | Add Multiple List State
I define a list (useState ([])). I want to fill a list as data comes to index 0 of this list first. For example, a value comes every second and writes it on the list. then I want to press the button, create a new lite for the first index of the list and start filling it. How can I
How to add two states to my component inputText in OnChangeText
I need to add two parameters to my onChangeText, but I don’t know how I can do that, My component is: The functions HandleDDD and Handle CelNumber are call where my param phone is true, but i need this change state with my onChangeValue aways, but the way I did, not work can you help me? Answer From on your
Passing arguments into props react-native?
I’m new to react and am trying to figure out how things like props work. I want to have it so I can pass a function which i know how to do but i want to do it with some argument. I know my switch statement works because if I manually set the value it works as expected. I’m just
how to filter an nested objects inside an array in javascript
I have the following nested objects in an array and i want to filter the result to return the id of a specific item. The solution i tried is returning null because of the nested objects structure i presume P.S: The structure of the data above is from the backend that iam working with. I am a beginner with javascript.
Data not saved with redux react for android
I probably missunderstood how does redux works but my datas are not saved into the store and i quit et re-open the app. Everything works perfectly when i keep my app open (I can add sessions, exercices…) and everything is saved but when i close it there’s no data. Do i’ve to write some code to receive the store data
accessing GeoPoint data from firestore document
I’m using react native and have firestore structured like this. and i want access the geopoint latitude and longitude. how do i do that? sorry i’m still newbie i’m getting error with this code Answer Firestore GeoPoint is not an array; it’s an object you can access the lat & long using their field names, like below
Querying Airport Lat and long from Airports.JSON react native
Im trying to query from a JSON file I import like this. you can find the File here I put it into a variable and get the lat from the first object perfectly fine. I have many objects to get the lat and long from so I tried a for loop I get Undefined for my console.log(airportLat) help would be
Navigate between different components React Native
So I’ve been trying to understand how to do this for like 2 hours now but I can’t seem to figure it out. I want to be able to go from one component to another when the button is clicked. First.js Second.js So I cut out some of my code with all the extra stuff but above is the two
FlatList scrollToIndex out of range
I have a FlatList where I’m trying to scroll through each index of my data array every X amount of seconds. There’s only two items in my array right now but there could be more. The current code works for the first two iterations but then it does not seem to reset properly and I get the scrollToIndex out of