We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 126790b commit 381dbe2Copy full SHA for 381dbe2
src/core/utils.ts
@@ -90,9 +90,11 @@ export function deepIncludes(a: any, b: any): boolean {
90
}
91
92
export function isDocumentVisible(): boolean {
93
- const visibilityState = document?.visibilityState as any
94
-
95
- return [undefined, 'visible', 'prerender'].includes(visibilityState)
+ // document global can be unavailable in react native
+ if (typeof document === 'undefined') {
+ return true
96
+ }
97
+ return [undefined, 'visible', 'prerender'].includes(document.visibilityState)
98
99
100
export function isOnline(): boolean {
0 commit comments