mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 12:13:11 +00:00
Recommend a real rAF polyfill
This commit is contained in:
@@ -23,10 +23,9 @@ ReactDOM.render(
|
||||
);
|
||||
```
|
||||
|
||||
React also depends on `requestAnimationFrame` (even in test environments). A simple shim for testing environments would be:
|
||||
React also depends on `requestAnimationFrame` (even in test environments).
|
||||
You can use the [raf](https://www.npmjs.com/package/raf) package to shim `requestAnimationFrame`:
|
||||
|
||||
```js
|
||||
global.requestAnimationFrame = function(callback) {
|
||||
setTimeout(callback, 0);
|
||||
};
|
||||
```
|
||||
import 'raf/polyfill';
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user