Skip to content

Commit

Permalink
Merge pull request #89 from transverse-dev/development
Browse files Browse the repository at this point in the history
πŸš€ Production: 0.0.77 - Toast SSR bug fixed
  • Loading branch information
cartoondev authored Sep 26, 2022
2 parents f9b47fe + 37e2159 commit 998b5cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/evoui/components/Toast/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,13 @@ function ToastCanvas() {
* main toast component
*/
export function Toast() {
return createPortal(<ToastCanvas />, document.body);
const [isDocumentReady, setIsDocumentReady] = useState(false);

useEffect(() => {
setIsDocumentReady(true);
}, []);

return isDocumentReady && createPortal(<ToastCanvas />, document.body);
}

/**
Expand Down

0 comments on commit 998b5cf

Please sign in to comment.