--

Yes! Admittedly, the component concept is pretty solid already, but a great example is useEffect. Classes have componentDidMount/componentDidUpdate to perform synchronous side effects before paint, roughly analogous to useLayoutEffect. But useEffect introduces asynchronous side effects after paint, which is much more responsive to the user for code that doesn’t alter the component’s presentation. There’s no roadmap to introduce that functionality to class components.

--

--

Michael Landis
Michael Landis

Written by Michael Landis

Front-end web developer, React enthusiast, vagabond.

Responses (1)