Back to all tasks

Build a Reactive Counter with React Hooks

Your task is to complete a basic counter component using React hooks. The Counter component should display a numerical value, and provide three buttons: "Increment", "Decrement", and "Reset".

Currently, the component has some structural issues and missing logic for state updates.

  • The count state is declared, but not correctly initialized or updated.
  • The event handlers for the buttons are incomplete or contain incorrect logic.
  • Ensure the component renders the current count and the buttons correctly, responding to user interactions.
build_a_reactive_counter_with_react_hooks.jsx
Loading...

Use the "Verify Solution" button to get AI feedback on your React code.