Skip to content

Commit 49ee183

Browse files
authored
Merge pull request #244 from reactjs/gaearon-patch-6
Recommend a real rAF polyfill
2 parents 13c0e48 + 37da66e commit 49ee183

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

content/docs/reference-javascript-environment-requirements.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ ReactDOM.render(
2323
);
2424
```
2525

26-
React also depends on `requestAnimationFrame` (even in test environments). A simple shim for testing environments would be:
26+
React also depends on `requestAnimationFrame` (even in test environments).
27+
You can use the [raf](https://www.npmjs.com/package/raf) package to shim `requestAnimationFrame`:
2728

2829
```js
29-
global.requestAnimationFrame = function(callback) {
30-
setTimeout(callback, 0);
31-
};
32-
```
30+
import 'raf/polyfill';
31+
```

0 commit comments

Comments
 (0)