← Questions

React class components, lifecycle methods and hooks

0
SnowflakeCodingLast asked Jan 2026

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.

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