Skip to content

Commit

Permalink
fix: check that document is also defined in client (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: BZ <[email protected]>
  • Loading branch information
atav32 authored Oct 2, 2020
1 parent d961353 commit 6376e86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-div-100vh/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ function useWasRenderedOnClientAtLeastOnce() {
}

function isClient() {
return typeof window !== 'undefined'
return typeof window !== 'undefined' && typeof document !== 'undefined'
}

1 comment on commit 6376e86

@vercel
Copy link

@vercel vercel bot commented on 6376e86 Oct 2, 2020

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.