← Questions
React class components, lifecycle methods and hooks
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Explain how React class components work and the order of their lifecycle methods (mount, update, unmount), then how the same behavior is written with hooks: useState, useEffect and its cleanup and dependency array, useMemo and useCallback. Say when each hook runs relative to rendering and what common bugs (stale closures, missing dependencies) look like.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
