Skip to content

Commit

Permalink
fix(toast): bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fluid-design-io committed Feb 5, 2023
1 parent 00812d5 commit 7616e37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/components/Toast/useToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ export function ToastProvider({ children }) {
});
}
}, [toasts.length]);

const windowExists = typeof window !== 'undefined';
if (!windowExists) {
return null;
}
return (
<ToastContext.Provider value={{ present }}>
{children}
Expand All @@ -207,7 +210,7 @@ export function ToastProvider({ children }) {
))}
</AnimatePresence>
</div>,
typeof document !== 'undefined' ? document.body : null
document.body
)}
</ToastContext.Provider>
);
Expand Down

0 comments on commit 7616e37

Please sign in to comment.