Loading problem…
Build a Whack-a-Mole game in React.
A grid of holes is shown. A "mole" appears in one hole at a time. The user clicks the mole to score points before it disappears.
interface WhackAMoleProps {
rows?: number; // default 3
cols?: number; // default 3
durationMs?: number; // default 30000
intervalMs?: number; // default 800
}> Note: Avoid memory leaks. Clean up timers/intervals on unmount and when stopping/resetting.
Example 1: