Create a component called
App that displays the number of times the user has hovered a button with the text “Hover Me”. The count should be displayed in an
h1 element and updated each time the user hovers over the
button. The initial value of the count should be set to
We have already written some starting code for you.
- Set the initial value of the hover count to 0.
- Return a
buttonelement with the text
- Do not edit the
- You can use the
useStatehook to store the data.
- Use the
onMouseEnterevent to detect if the user has hovered over the button.