Build this React exercise in 20 minutes.
Build a local reaction pair with baseline counts of 128 likes and 4 dislikes. The baseline excludes this visitor. A visitor has exactly one of three states: neutral, like, dislike. Clicking the active reaction clears it; switching moves the visitor’s one vote. No persistence, API, loading state, or optimistic write is required.
Acceptance checks
- Neutral → like → dislike → neutral gives counts 128/4 → 129/4 → 128/5 → 128/4.
- Repeated toggles and switching never drift from baseline plus the current reaction.
- Queued toggles compute from the latest state; only one button can be pressed.
- Buttons expose selected text and aria-pressed, and can be activated by Enter/Space.
The checks are a manual interview checklist; saving a submission does not execute them.
Learn and continue
Prerequisite: Functional state updates. Work through the React Machine Coding Foundations path to practice related skills in order.