Handle nullish values being passed into clickoutside util

This commit is contained in:
Andrew Kingston 2022-11-22 16:43:34 +00:00
parent 29cf6e2130
commit f152c0555e
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
export default function clickOutside(element, callbackFunction) {
function onClick(event) {
if (!element.contains(event.target)) {
callbackFunction(event)
callbackFunction?.(event)
}
}