A toast is a small message that pops in to confirm something happened — "Saved successfully" — and then quietly disappears on its own a few seconds later. Building one in React is a lesson in one thing: a timer is a side effect, and side effects need to be tracked so you can cancel them.
The starter App.tsx renders a single Show notification button. Make it work:
Saved successfully.setTimeout hides the toast 3000ms later.× button that hides it immediately and cancels the pending timer.× right away: the toast disappears now, and the 3s timer never fires (because you cleared it).visible boolean plus a fixed message — not a queue. That's the EASY version.useRef, not useState — nothing renders from it, and changing it should not trigger a re-render.show so rapid clicks can't stack timeouts.useEffect cleanup that clears the timer stops it firing after the component is gone.