2 ms·
They very purposefully didn't add useOnMount because of the subtle bugs developers introduce when they do things only on mount. People would react to the initia
by madeofpalk 4y ago
They very purposefully didn't add useOnMount because of the subtle bugs developers introduce when they do things only on mount. People would react to the initial props in componentDidMount, but never respond to their change.
Hooks, and useEffect, was supposed to be designed in a way to eliminate that class of bugs.