Counter with reset

Hooks & State — Beginner React challenge.

Build a classic counter component. It exposes three actions — increment, decrement, and reset — and always renders the current count in an element with `data-testid="count"`.

Requirements

Signature

function Counter(): JSX.Element

Example

<Counter />
// clicking Increment twice ⇒ count === 2
// clicking Reset          ⇒ count === 0

Constraints

🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code
Loading workspace…