Skip to content

Commit

Permalink
Replace typeof document checks with typeof window checks
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Jul 5, 2024
1 parent 3abef0f commit a2c6743
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-pdf/src/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { PageCallback } from './types.js';
/**
* Checks if we're running in a browser environment.
*/
export const isBrowser: boolean = typeof document !== 'undefined';
export const isBrowser: boolean = typeof window !== 'undefined';

/**
* Checks whether we're running from a local file system.
Expand Down
2 changes: 1 addition & 1 deletion test/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import invariant from 'tiny-invariant';
/**
* Checks if we're running in a browser environment.
*/
export const isBrowser = typeof document !== 'undefined';
export const isBrowser = typeof window !== 'undefined';

/**
* Checks whether a variable provided is a string.
Expand Down

0 comments on commit a2c6743

Please sign in to comment.