Build a digital clock that shows the current time and ticks every second. It's the canonical "side effect on a timer" component: store the current time in state, start an interval on mount that refreshes it, and clear that interval on unmount. The display is just the time formatted as HH:MM:SS.
// A self-contained component. No props.
function App(): JSX.Element;
An HH:MM:SS display that advances once per second.
9:05:03 -> "09:05:03" (each part zero-padded to two digits)
ticks every second; on unmount the interval is cleared (no leak)
derive from a Date: getHours(), getMinutes(), getSeconds()
Date (or the formatted string); re-render on each tick.setInterval(…, 1000) in an effect with []; return clearInterval.padStart(2, '0') so 9 -> "09".