This is for a React Native Chat app. My data should be something like this: I am listing the Chat list using a FlatList: The messages shows like this all stacked up and I am not what is the workaround. What I am trying to achieve is displaying the last message based on timestamp. Answer To get the last messag…
Tag: react-native
scrollToIndex out of range: request index1 but maximum is -1 .. React Native
when I run my application it’s okay and work If I create an array and put it in the data in FlatList like this array But when I replace the photos array with an API, The app doesn’t work. I tried more than API, I think the error is in my code not in the API, This error appears to
Mobx state updating in console log, but not re-rendering
I’ve created a MobX store (React Native project) and am updating a state value on button click. The state is successfully updating as displayed in a console log, but the DOM is not re-rendering with the updated state. Most answers on SO are a little outdated as they recommend adding @observable in the r…
Using firebase authentication and firestore to add user
Im trying to use user to the authentication of firebase and also firestore. Whhen I click on Save, the function SavePress is activated. The first time I click on this button, the user is added to firebase authentication but user is equal to null. Only at the second time it’s work. If anyone can help me.…
React Native change the zoom of iframe using WebView
Hello, It is frst time I am using React Native you could say and trying to use the WebView from the react-native-webview library. Inside the WebView I have a iframe tag that I want it to strect out …
Remove an object with the same value of an array inside an array javascript
I have array like this: Then I filter the number to get a number that is less than or equal to 10 digits. Then returns an array with items that do not match a number. I then iterate through each of the above items, then push it into an empty array to get each individual item. And my final result
I can`t read the data after I update my rules on firestore (React Native)
the rules I set is allow read: if resource.data.uid == request.auth.uid; how I call it is like this How can i fix it? firebase rule image for the data https://1drv.ms/u/s!Ag7uBMx2FuEijuILje2xJIv8RawcFA?e=Gy6jeC Answer Rules don’t filter data on their own. Instead they merely ensure that the data that is…
Expo listen for browser dismiss
In my expo react native app, the user is directed to a URL in a WebBrowser. I would like to be able to listen for when the user closes/ dismisses the WebBrowser and then execute a function. Is this possible? Answer I solved this by using an authentication session (openAuthSessionAsync) instead of a standard w…
Exception: undefined is not an object (evaluating ‘navigation.navigate’)
I’ve four screens in a Stack navigator in Books.js: From the BooksMenu screen user is navigating to the MyBooks screen and from the MyBooks there is a button that navigates the user to MyBooksDetails screen. This error pops-up with I click on the button that is supposed to navigate the user to MyBooksDe…
TypeError: Cannot read property ‘qty’ of undefined. React Native Redux
I try to build an application called Cake Shop to sell and make Cakes, I have a problem reducing the number of cakes in my State, Here is my initial State I think the problem is here in my Reducer, I want to reduce the quantity every time I dispatch the action. This My Action That’s how I call the