I am developing a web app with react front-end and node baack-end I want to delete the cookie being stored so that I can successfully be able to logout the user. I have tried using the js-cookie library and react-cookie library but it does not work. nav_component: How I set the cookie in the backend: It should be noted that
Tag: reactjs
Is there a way to get all data from a firestore database using useCollectionData()?
I have a React project and in it I have the following code: (using this react hook for firebase) Instead of this, I don’t want the query to be ordered or have a limit, is there a way to make an “empty” query to get all the data from a certain collection? Answer If you pass messagesRef instead of a
URL.createObjectURL wouldn’t work asynchronously (React)
URL.createObjectUrl wouldn’t work when I re-upload another file after uploading at the first time. videoFile is updated but it doesn’t generate object url… Answer It works. Just render the video element when file exists. Refer to the working example on Codesandbox.
ReactJS: How to update a boolean field in an API using a POST request
So what I am basically doing is, I have an API of call activities and its own details. I have to archive a call and in that API of calls, each call has a field called “is_archived” I need to be able to update the API using a click of a button to archive a call. (So basically change the
React JS sorting issue
I’m trying to sort some data in my application. I’d like to support the following options: Price (low to high) Price (high to low) Mileage (low to high) Mileage (high to low) It looks like price sorting is working. However, when I click on “lowest mileage”, it keeps showing the highest price results – the old value of sorting. I
Push data inside an array index. React Native JSX
I am trying to compare, find and push data inside an array. But getting following error Error => TypeError: undefined is not an object (evaluating ‘data[index].push’) I have following JSON/Array I want to push packages object inside matching category so json/array will be as follows Following is the code what I was trying to do: Answer I don’t know how
React Native Text Input focus with useRef using Typescript
I have an issue with focusing the next input in React Native. I use just one input called GeneralTextInput.tsx in the whole app. In this example I have 2 inputs ==> 1.Group Name, 2.Group Description So I give some props in the parent to this component: And this is my GeneralTextInput.tsx What should I give to the input as a
How to pass index to child function
Here is the question. I want to pass index of each child element to the function handleChange, but I can’t get it))) When I click on TabPanelItem appears error handleChange is not a function What’s the problem? Parent Element: and my child component: Answer you made a mistake in this line you dont handleChange in the tablePanelItem it should be
Firebase Firestore db.collection is not a function
I am developing a shift scheduler and I use firebase authentication and firestore. My idea is that when a user signs up it creates a document in collection “workers” and sets the doc id to the user’s email. When the user adds a shift I want to add the shift info into a sub-collection “shifts” inside that user’s document where
Error: Absolute route path “/” nested under path “/app” is not valid
I suddenly get this error and not sure why.I did not change the “react-router-dom”: “^6.0.0-beta.4” version. But the “react-dom”: “^16.8.4″” had changed to “react-dom”: “^16.13.1”, Dunno if that had anything to do with I don’t know but the useRoutes comes from “react-router-dom” and that’s where the error originate ya. Anyone have a clue? Here is my App.jsx where i use