Skip to content

Commit 833c915

Browse files
committed
fix: prevent error in Tooltip component on server-side rendering
1 parent 41c29f3 commit 833c915

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/components/primitives/Tooltip.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default function Tooltip({ helper, onOpen, children, icon = true, classNa
1818
const [isTouchDevice, setIsTouchDevice] = useState(false);
1919

2020
useEffect(() => {
21+
if (typeof document === "undefined") return;
2122
if (!("ontouchstart" in window)) return;
2223
setIsTouchDevice(true);
2324
}, []);

0 commit comments

Comments
 (0)