I am working on a MERN ecommerce stack application. I have an API that returns all the Products I have from my MongoDB. I have attached a console log of the pro
I'm trying to re-run the useEffect hook based if any new item has been added to the localstorage. My useEffect looks like this : useEffect(() => { //ge
I am facing one problem when trying to add a spinner. My problem is when I add "product" dependency in useEffect hooks then my loading spinner always spinning a
My app has a test sheet, if a user passes the test he is shown a passing screen and then the state is saved using asyncstorage. But the problem here is, let's s
I am trying to make a test sheet for user. If he passes the test, he is directed to a pass screen and even after totally closing the app, when that specific use
I have two dispatch actions 1. fetchHomepage and 2. removeHomepage. I want to run removeHomepage action when I click other link on header menu. So I added remov
We are building a chat app using Firestore and React. Users should be able to up/down-vote each other's messages. We have two Firestore collections: messages: c
import React, { useState, useEffect, useRef } from "react"; import ReactDOM from "react-dom"; import "./styles.css"; function App() { const [minus, setMinus
I'm trying to render data that must be passed through useMemo. I get the data from an api call so I call useEffect. The initial render works returning an empty
I'm new to React Hook and I follow severals tutorials but I'm afraid I'm not understand everything. I have two components with pretty much the same code but two
I have a small problem with act() error in react-testing-library. In useEffect I try to call an function that is a promise. Promise returns some data and displa
function deleteTask(id) { const remainingTasks = tasks.filter((task) => id !== task.id); setTasks(remainingTasks); } Ijust want to know in plain english, as
I'm trying to use useEffect function like that: const [data, setData] = useState({ courses: [] }); useEffect(async () => { const result
There are n items the user can vote on. There are two React states: votes is an array of the user's votes on every item. const [votes, setVotes] = useState({});
I'm new to react and when I'm updating my state in redux, I'm no able to see my state updated in my component inside a setInterval, despite the state in redux i
I've created a canvas which is set to a state using a callback. circles are then created based on mouse x and y that are then drawn to the canvas state after cl
i am trying to fetch multiple endpoints in UseEffect and depending on it's result show data on the UI (avatar, username, etc.) Problem is, that the data receive
Im trying to create a drawing application in react, its working for the most part. But when i try add an undo button it doesnt work. I try make the undo button
I have a problem, on the two functions below, when I check the debug of my request, there is an infinite loop of my GET request and I don't un
This is a component that render data from firebase storage and make it listed. What the function has to do is set the videos extracted from firebase storage to