Skip to content

Commit

Permalink
fix: adjusting document check for SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
michellocana committed Feb 21, 2020
1 parent fa87bdc commit bd68002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -7,7 +7,7 @@ export interface ScrollbarWidth {
export const scrollbarWidth: ScrollbarWidth = (force?: boolean): number | undefined => {
// safety check for SSR
/* istanbul ignore next */
if (!document) {
if (typeof document === 'undefined') {
return 0;
}

Expand Down

0 comments on commit bd68002

Please sign in to comment.