Skip to content

Commit b13640a

Browse files
authored
fix: use globalThis over global (#4448)
1 parent 90ae846 commit b13640a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/blog/2022-03-08-react-18-upgrade-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ When you first update your tests to use `createRoot`, you may see this warning i
227227

228228
> The current testing environment is not configured to support act(...)
229229
230-
To fix this, set `global.IS_REACT_ACT_ENVIRONMENT` to `true` before running your test:
230+
To fix this, set `globalThis.IS_REACT_ACT_ENVIRONMENT` to `true` before running your test:
231231

232232
```js
233233
// In your test setup file
234-
global.IS_REACT_ACT_ENVIRONMENT = true;
234+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
235235
```
236236

237237
The purpose of the flag is to tell React that it's running in a unit test-like environment. React will log helpful warnings if you forget to wrap an update with `act`.

0 commit comments

Comments
 (0)