A
A
Andrey Okhotnikov2019-11-19 11:41:43
React
Andrey Okhotnikov, 2019-11-19 11:41:43

useEffect hook on first render?

I have a useEffect that should fire when one of the fields (conditional A, B, C) changes.
But when the component is first rendered, it turns out that it fires 3 times, respectively. How to fix it
useEffect(() => {}, [A, B, C])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Laud, 2019-11-19
@kshshe

Change the operation of the component so that the first values ​​A, B and C do not come in turn, but all at once.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question