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

  • 0
    Hello.
    I would be grateful for your help. I've been sitting over the problem for a long time. Basically I'm doing a simple field check (validation).
    I can't figure out why my useEffect hook is being called (I'm guessing) an infinite number of times.
    Although the dependencies indicated.

    I would be grateful for your help!
    Link: https://codesandbox.io/s/login-14112020-81f6f
    JavaScript Evan May, May 19, 2020

  • 2 Answers
  • 0
    Found a solution. Extra dependencies were in useEffect.
    Anonymous

  • 0
    because your errorsState is an object and you update it every time in the effect
    Eli Valdez

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!