Closed V-iktor closed 1 year ago
I was able to solve this issue by explicitly specifying the type of useClickAway
like this:
const ref = useClickAway<HTMLDialogElement>(() => {
...
})
The same goes for other elements as well. If you want to reference, for example, a div
, you should specify <HTMLDivElement>
This example is not working in Typescript 5 with React 18
https://usehooks.com/useclickaway