O
O
OWIII2020-11-14 19:13:58
JavaScript
OWIII, 2020-11-14 19:13:58

What is the reason for the infinite re-rendering of the component?

Hello.
I will be grateful for help. I've been sitting on this problem for a long time. As a matter of fact I do simple check of fields (validation).
I can't figure out why I'm calling the useEffect hook (I'm guessing) an infinite number of times.
Though dependences specified.

I will be grateful for your help!
Link: https://codesandbox.io/s/login-14112020-81f6f

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OWIII, 2020-11-14
@OWIII

Found a solution. The extra dependencies were in useEffect.

D
Dasha Tsiklauri, 2020-11-14
@dasha_programmist

because your errorsState is an object and you update it every time in the effect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question