I’m trying to read and write to firestore, use firebase’s authentication, and firebase’s storage within a expo managed react-native application. Full Error: My firebase config file: I installed the firebase package with: Any help would be greatly appreciated. Thank you! Answer To reduce the …
Tag: react-native
Jest coverage tools fail
During in my react-native project, during test execution, Jest shows coverage and creates coverage reports. Jest config: During testing I get errors: in files which are generated during creation of coverage folder: So, in jest documentation we see that we can specify jsdom environment in file which produces e…
How to avoid re rendering text input?
I have a TextInput and I don’t want it to re render every time I change the value inside it but I want to be able to change the value inside the input at the push of a button that’s why I haven’t just used defaultValue any solutions?? Answer You can use useRef to save text from text input wi…
How to detect a frozen video stream in WebRTC
Unfortunately, from time to time when making a one-on-one video call using react-native-webrtc one of the two video streams freezes or becomes black. Is there a way to detect when that happens programmatically? Thx in advance! Answer It looks like each video track has a listener that fires as soon as the stre…
How to throw Catch in fetch POST request in react native
I am having a problem with calling an error when i call a POST request in React Native, i know that there is a catch but it only throws for network connections, how do i do that with errors i get from the response when i have a wrong password or wrong username like when this Error is called from
react native useState is not incrementing counter
When counter is >= data Array length setLoading should trigger. But counter is not being incrementing until I refresh app by pressing CTRL+S then counter increment itself by 1 every time app refreshes. Answer Updating state is an asynchronous operation, so getting loopCount in for loop will get the initial…
Update timestamp text after a given time in React
I’m building a component for notifications. It looks like this: This is React Native, but it shouldn’t matter. What I want is, if the notification is from a minute ago to display Just now. If it is from more than a minute ago to display to full time. It is working okay, but it stuck on Just now. M…
TS2307 Error: Cannot find module ‘../constants’ or its corresponding type declarations
I am currently getting the error while trying to import. Any help or suggestions will be greatly appreciated. tabs.tsx | src>navigation>tabs.tsx Structure tsconfig.json Answer The error tells you there’s nothing to import from the location it’s currently pointed at. import-ing from a folder …
delete a collection with document and collection again inside (firestore react native)
I am having trouble deleting on firestore here’s my delete but everytime i try to delete nothing happens . There’s no error at all . this is how I set that collection Answer If you want to delete all the docs of the messages (sub)collection, you need to query the collection and delete each documen…
TypeError: this.state.data.map in reactjs
Hii All , I know this question is asked many times but I cant figure it out I’am getting the error. I have checked for all the questions similar to this but haven’t found specific solution if I use another link i.e, “https://jsonplaceholder.typicode.com/users” this one the code works f…