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
Like the title says, the localStorage I set registers the changes made to the todoList array and JSON.stringifys it; however, whenever I refresh the page the ar
This is a part of use-deep-compare-effect source code export function useDeepCompareMemoize<T>(value: T) { const ref = React.useRef<T>(value) co
I'm trying to get the value of an autocomplete field outside of my formik component everytime it changes, and i did something like this: const formRef=useRef<
getTransactions method call need to be called only if user is logged in, but the info about the user will not be visible. What can I do to force a reload when o
I am writing an axios get call useEffect that is called whenever a user selects an option from a dropdown menu. It works on getting info on the first time I sel
Learning React here, and I'm simply trying to display a lottie animation. Seems fairly straight-forward, but I'm having some trouble with the useEffect hook.
const [text, setText] = useState(''); const handleTextChange = (e) => { setText(e.target.value); } // Inside a form <input onChange={handleTextChange