I am new to firebase / firestore and am trying to create a new collection upon login and authenticating a user, on client side and using React. I read a few other articles here and I set the db rules to true for both read and write, but yet, I keep getting an error on the Firestore db, while it
Tag: reactjs
React Native TextInput not scroll in ScrollView
I write a code like this: but when i drag start in TextInput does not scroll! i drag like this picture: enter image description here but not scroll… Answer Problem solved. I just add this props to TextInput Components:
Socket listener not getting updates from React state
I have a component in which I set my state from the passed parameters to the component I set the activeList state from the passed params and then on click I update the state in order to show filtered results So ultimately users can filter their chat lists based on the chosen index And everything works fine, t…
How can I check by React Hook Form if password contains a number?
How can I check by React Hook Form and Yup if password contains a numbers, capital letters and special signs? I tried something like this below, using validate function but it doesn’t work correctly. I have an error ‘Cannot read property ‘reduce’ of undefined’. Answer I think the…
URIError: failed to decode param “/%PUBLIC_URL%/favicon.ico”
Please help fix I ran into this error after deploying my webpage to git-pages, now after running my React app it compiles successfully but does not display anything in the browser when you refresh the page this error pops up on the console. link to the React app Answer Please follow the steps given on this re…
Using UseState in Reactjs
I am trying to map the values of userIDs to listUserIds, and then use values of listUserIds as keys in listUser function. But it only show the last value. What did I go wrong? } Answer You can set the values like this. using map you can collect all the ids then you can update the state.
Retrieve information from a route according to the route dynamically
I have created routes to display the pages that are linked to them, I now want to retrieve this information when I am in a page. Here is an example of a route: I want to display for example the ID in my header, how can I do ? I tried this solution but I can’t get the routes with
Only allow one React Accordion to be expanded at once
I have an array of data that will be used to create accordions, I’d like to make it so that only one of them can be expanded at once (i.e, if the user expands accordion #1 and then #2, #1 will un-expand) I have this code: I’m quite new to React so I suspect I’ve made a mistake with the
Data defined, but return undefined
I get an error after compiling it but I have defined it and fetch the data using async await but get a TypeError: data[index] is undefined I have stuck for several hours and still come out with no solution. Furthermore, I have tried to destructed it but still get the same error. Using data.map() works, but I …
How to override div onClick event when button is clicked?
I am trying to stop the parent div from executing an onClick event when the child Delete button is clicked. I tried to implement event.stopPropogation however, it gives me an error. Answer In case anyone has the same problem as me, simply use e.stopPropogation(). This stops the click event from bubbling up to…