Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

ensure window is not undefined

Emil Kowalski59ad745971dd
diff --git a/src/index.tsx b/src/index.tsx
index b5b5d5f..3bac0fa 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -109,9 +109,11 @@ export function Root({
}, TRANSITIONS.DURATION * 1000);
if (o && !modal) {
- requestAnimationFrame(() => {
- document.body.style.pointerEvents = 'auto';
- });
+ if (typeof window !== 'undefined') {
+ window.requestAnimationFrame(() => {
+ document.body.style.pointerEvents = 'auto';
+ });
+ }
}
if (!o) {