There was an error while loading. Please reload this page.
1 parent 2ba6c15 commit 26b13afCopy full SHA for 26b13af
1 file changed
packages/eds-utils/src/hooks/useDeprecationWarning.ts
@@ -1,7 +1,5 @@
1
import { useEffect, useRef } from 'react'
2
3
-declare const process: { env?: { NODE_ENV?: string } } | undefined
4
-
5
/**
6
* Hook that displays a deprecation warning in the console during development.
7
* The warning is only shown once per component instance and only in development mode.
@@ -32,10 +30,8 @@ export const useDeprecationWarning = (
32
30
let isDevelopment = false
33
31
34
// Check Node.js environment (for tests and SSR)
35
- if (
36
- typeof process !== 'undefined' &&
37
- process.env?.NODE_ENV === 'development'
38
- ) {
+ const g = globalThis as { process?: { env?: { NODE_ENV?: string } } }
+ if (g.process?.env?.NODE_ENV === 'development') {
39
isDevelopment = true
40
}
41
0 commit comments