Hmm yes, but honestly it's best to forget about lifecycle methods altogether, I've noticed some people switching from class components to hooks, trying to copy their lifecycle methods, but that won't work well. In class components there was no notion of dependencies, which is an important part of the hooks API. People moving their lifecycle methods from class components to hooks will try to work around this problem by either omitting dependencies from the useEffect hook, or trying all kinds of conditional logic inside the useEffect, to avoid triggering from its dependencies. In both cases the component will not work as expected.
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.
Hmm yes, but honestly it's best to forget about lifecycle methods altogether, I've noticed some people switching from class components to hooks, trying to copy their lifecycle methods, but that won't work well. In class components there was no notion of dependencies, which is an important part of the hooks API. People moving their lifecycle methods from class components to hooks will try to work around this problem by either omitting dependencies from the useEffect hook, or trying all kinds of conditional logic inside the useEffect, to avoid triggering from its dependencies. In both cases the component will not work as expected.