File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import React , { useEffect , useLayoutEffect } from 'react'
2
- import { hasRequestAnimationFrame , isWindowDefined } from './helper'
2
+ import { hasRequestAnimationFrame , isLegacyDeno , isWindowDefined } from './helper'
3
3
4
4
export const IS_REACT_LEGACY = ! React . useId
5
5
6
- export const IS_SERVER = ! isWindowDefined || 'Deno' in globalThis
6
+ export const IS_SERVER = ! isWindowDefined || isLegacyDeno
7
7
8
8
// Polyfill requestAnimationFrame
9
9
export const rAF = (
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ const STR_UNDEFINED = 'undefined'
10
10
// NOTE: Use the function to guarantee it's re-evaluated between jsdom and node runtime for tests.
11
11
export const isWindowDefined = typeof window != STR_UNDEFINED
12
12
export const isDocumentDefined = typeof document != STR_UNDEFINED
13
+ export const isLegacyDeno = isWindowDefined && 'Deno' in window
14
+
13
15
export const hasRequestAnimationFrame = ( ) =>
14
16
isWindowDefined && typeof window [ 'requestAnimationFrame' ] != STR_UNDEFINED
15
17
You can’t perform that action at this time.
0 commit comments