Build a component that increments counter with mouse cursor inside a box

Michael Tong
1 min readAug 4, 2023
Photo by Jeff Sheldon on Unsplash

Today we will built a simple react component that increments a counter quickly when the mouse is hovering over a box.

Step 1: As always open you react codesandbox link.

Step 2: under the src folder, open the index.js file and replaced with the following:

--

--