Category "use-effect"

Hello, so im using localstorage to store my input data from tags created. so i have multiple input fields,

So basically the issue i'm having is: For every user, lets say theres tom and daniel, with different details each, with an input bar to add tags. So if i add tw

I define column index parameter in my arrow function but i can use in my useEffect causes is not define

I define column index parameter in my arrow function but I can use in my useEffect causes is not define! What can I do? useEffect(() => { const resizeOb

React useEffect Dependecy releated Problem

In React I have used useEffect to fetch data. But I have confusion when I have to mention the dependency and when I have to keep it empty

Trying to send props value once only in react JS

I have make a slider using carousel at Trip.js and in Home.Js I have created a review section by my self using useEffect and Everytime the slide changes it retu

UseEffect firing on initial render

I am creating a front end for an API that requires a user to input both an API key as well as a device name. The issue is that the UseEffect() fetch is firing w

Style with text freezes Openlayers react / capacitor app on IOS after unlock (

I'm writing a cross-plattform react application with capacitor and facing freezes in the IOS application (IOS version 15.3.1 - also occured on lower versions) w

Filter is not a function using React UseEffect of a data from MongoDB

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

How do i re-run useEffect hook if the localstorage value has been changed?

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

How to fix loading spinner when using useEffect Hooks with dependency list?

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

state is not getting updated for a new user in react native

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

why i have to refresh/rewrite my code to make it work while trying to save the state for a specific user in react native

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

Cleanup Function is not running in useEffect in React Redux

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

Firestore & React: Update the Same State in Multiple Firestore onSnapshot Listeners

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

useEffect is not called when dependencies change

import React, { useState, useEffect, useRef } from "react"; import ReactDOM from "react-dom"; import "./styles.css"; function App() { const [minus, setMinus

Can a useMemo memoized value be updated with useEffect from within the component?

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

React Hook - useEffect same code but severals behaviors

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

How to resolve act() in useEffect?

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

filter operator explained step by step

function deleteTask(id) { const remainingTasks = tasks.filter((task) => id !== task.id); setTasks(remainingTasks); } Ijust want to know in plain english, as

TypeError: func.apply is not a function

I'm trying to use useEffect function like that: const [data, setData] = useState({ courses: [] }); useEffect(async () => { const result

Can a React usestate update be nested in another useState functional update?

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({});