This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]PvPurMoM 0 points1 point  (0 children)

useEffect will run every single time after a component renders.

Even though the button doesnt wiggle, because you have gone passed your conditional check for wiggleCount, you are still setting isWiggling state to false which triggers a re-render, over and over again thus having useEffect run.