The useEffect call in your example is missing an empty dependency list. This probably isn't quite doing what you think: it's setting up a new timeout every time the component re-renders.
Ironically, a class component almost certainly wouldn't have such a problem because of the clearly named componentWillMount method.
That said, helpful article and I am generally a fan of function components.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The useEffect call in your example is missing an empty dependency list. This probably isn't quite doing what you think: it's setting up a new timeout every time the component re-renders.
Ironically, a class component almost certainly wouldn't have such a problem because of the clearly named
componentWillMount
method.That said, helpful article and I am generally a fan of function components.