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