useWindowEvent

useWindowEvent is a custom hook that assigns an event listener to window.

Click count: 0

Usage

import { useWindowEvent } from "@yamada-ui/react"
const [count, setCount] = useState(0)

useWindowEvent("click", () => {
  setCount((prev) => prev + 1)
})