Skip to content

Commit

Permalink
Fix canUseDOM breaking SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbarbara committed Jan 17, 2025
1 parent 69dd086 commit 1fa497d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function randomCharacter(character: string) {
}

export function canUseDOM(): boolean {
return !!window?.document?.createElement;
return !!(typeof window !== 'undefined' && window.document?.createElement);
}

export function isSupportedEnvironment(): boolean {
Expand Down

0 comments on commit 1fa497d

Please sign in to comment.