We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Element
1 parent 5ca68a9 commit bbe22d2Copy full SHA for bbe22d2
packages/@headlessui-react/src/hooks/use-transition.ts
@@ -7,12 +7,13 @@ import { useIsoMorphicEffect } from './use-iso-morphic-effect'
7
if (
8
typeof process !== 'undefined' &&
9
typeof globalThis !== 'undefined' &&
10
+ typeof Element !== 'undefined' &&
11
// Strange string concatenation is on purpose to prevent `esbuild` from
12
// replacing `process.env.NODE_ENV` with `production` in the build output,
13
// eliminating this whole branch.
14
process?.env?.['NODE' + '_' + 'ENV'] === 'test'
15
) {
- if (typeof Element.prototype.getAnimations === 'undefined') {
16
+ if (typeof Element?.prototype?.getAnimations === 'undefined') {
17
Element.prototype.getAnimations = function getAnimationsPolyfill() {
18
console.warn(
19
[
0 commit comments