Skip to content

Commit

Permalink
Fresh deno compatibility (#263)
Browse files Browse the repository at this point in the history
Add check on document, otherwise document is not defined in fresh
  • Loading branch information
hapaxlife authored Dec 23, 2023
1 parent 35514dc commit c4ff085
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

1 comment on commit c4ff085

@vercel
Copy link

@vercel vercel bot commented on c4ff085 Dec 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.