100 JS Functions

Beginner

1. CurrentYear

2. SimpleCounter

3. DoubleNumber

4. CreateColor

5. DynamicGrid

6. DynamicPictureSize

7. RandomButton

8. TabbedNavigation

9. MathOperator

10. GuessTheNumber

11. BetweenDates

12. Reactions

13. FeedTheBunny

14. Countdown

15. ClickFast

16. SkillsForJobs

17. UsersTabel

18. TodoList

19. UserSearch

20. SpendingInfo

15.ClickFast

Write a React component named ClickFast that renders two buttons: a Start and a Click me fast (initialy disabled).

When the user presses Start:

  • A countdown timer appears on the screen, starting at 5 seconds (e.g., 3s left).
  • The Click me fast button becomes enabled.

During these 3 seconds, the user can click the Click me fast button as many times as possible. Once the countdown ends:

  • The button is disabled again.
  • The timer disappears.
  • A result message is displayed:
    • "You clicked x times!" if there were clicks.
    • "No clicks recorded." if there were none.

Example 1

Input

No input props

Demo

Open demo in new window

You'll see test results here!