From c4ff0853c65b5a4453557c3396dfc9788c35acf2 Mon Sep 17 00:00:00 2001 From: hapaxlife <97401010+hapaxlife@users.noreply.github.com> Date: Sat, 23 Dec 2023 17:03:45 +0100 Subject: [PATCH] Fresh deno compatibility (#263) Add check on document, otherwise document is not defined in fresh --- src/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.tsx b/src/index.tsx index ab59831..ecdd523 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -398,6 +398,7 @@ const Toast = (props: ToastProps) => { function getDocumentDirection(): ToasterProps['dir'] { if (typeof window === 'undefined') return 'ltr'; + if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose const dirAttribute = document.documentElement.getAttribute('dir');