I\'ve got the \"Object is possibly null\" error many times and usually I use a safety \"if statement\" in case it returns null.
I\'ve got the following function:
If you want to "pass/skip" then this will do it const overlayEl: any = useRef(null);
const overlayEl: any = useRef(null);