We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00812d5 commit 7616e37Copy full SHA for 7616e37
src/lib/components/Toast/useToast.tsx
@@ -184,7 +184,10 @@ export function ToastProvider({ children }) {
184
});
185
}
186
}, [toasts.length]);
187
-
+ const windowExists = typeof window !== 'undefined';
188
+ if (!windowExists) {
189
+ return null;
190
+ }
191
return (
192
<ToastContext.Provider value={{ present }}>
193
{children}
@@ -207,7 +210,7 @@ export function ToastProvider({ children }) {
207
210
))}
208
211
</AnimatePresence>
209
212
</div>,
- typeof document !== 'undefined' ? document.body : null
213
+ document.body
214
)}
215
</ToastContext.Provider>
216
);
0 commit comments