import { useState } from "react";
import { useWindowEventListener } from "rooks";
import "./styles.css";
export default function App() {
const [value, setValue] = useState(0);
useWindowEventListener("click", function() {
setValue(value + 1);
});
return (
<div
className="App"
style={{
padding: "20px",
}}
>
<h2>Click anywhere</h2>
<p> Value is {value}</p>
</div>
);
}