URLSearchParams with axios in react-native

I was trying to request both request-body data, and URLSearchParams to my API in my react-native application. I initialized an axios instance as, const api = axios.create({ baseURL: BASE_URL, …

Error using new Date() in react Native is not a constructor

When I use new Date(); in react native to create a new date or time I get the error: TypeError: undefined is not a constructor (evaluating ‘new _reactNative.Date()’) What could be causing this? Is …

Add a new image with the existing image list in firestore database

I have already two images in the firestore database, I am trying to add a new image to this list? How can I add a new image to the existing image list?

Is there any way to check a image size before uploading in react native?

I am currently using image picker and image manipulator in my project for uploading and compressing the image. But I want to show user that he cannot upload image greater than any particular size(let’…

Trying to increment an integer in an Array

Good Evening, I am trying to increment an integer that I have index position of ‘0’ in my array, each time my function gets called. I have the variable added with .push, but then I just want to add …

React Native: Why is Expo-AV not playing audio?

I’m attempting to build an app that acts as a soundboard and can play different sounds when different buttons are pressed. I expected the audio to play but instead, I got an error that stated: …

Can’t Post JSON with Javascript ‘fetch’ in React Native?

I’m currently working on a really simple project. When I tried to console log req.body it gives me empty object. app.js (React Native) const musicPlayingHandle = () => { setMusicPlaying(!…

Async Storage in React Native showing only first time saved data

I am trying to save data into async storage every time when data in redux store changes, But I am getting an error when I am trying to update user’s Name and saving it then I am able to see the …

How to Map objects inside an array – Javascript

This is for a React Native Chat app. My data should be something like this: const data = [ { id: 1, name: John Doe, messages: [ {text: ‘Hello’, sentAt: ‘time here’}, {text: ‘How …

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 …