Handle nullish values being passed into clickoutside util

This commit is contained in:
Andrew Kingston 2022-11-22 16:43:34 +00:00
parent be3a004310
commit 91b9396212
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)
}
}