File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,9 @@ function useTooltip<ElementType extends HTMLElement>({
296296 ourHandler : ( event : EventType ) => any
297297 ) {
298298 // Use internal MouseEvent handler only if PointerEvent is not supported
299- if ( "PointerEvent" in window ) return theirHandler ;
299+ if ( typeof window !== "undefined" && "PointerEvent" in window ) {
300+ return theirHandler ;
301+ }
300302
301303 return wrapEvent ( theirHandler , ourHandler ) ;
302304 }
@@ -666,7 +668,11 @@ function useDisabledTriggerOnSafari({
666668 ref : React . RefObject < HTMLElement > ;
667669} ) {
668670 React . useEffect ( ( ) => {
669- if ( ! ( "PointerEvent" in window ) || ! disabled || ! isVisible ) {
671+ if (
672+ ! ( typeof window !== "undefined" && "PointerEvent" in window ) ||
673+ ! disabled ||
674+ ! isVisible
675+ ) {
670676 return ;
671677 }
672678
You can’t perform that action at this time.
0 commit comments