Browse Source

Suggest raf package in the blog post (#284)

main
Dan Abramov 7 years ago
committed by GitHub
parent
commit
30ff7eed55
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      content/blog/2017-09-26-react-v16.0.md

7
content/blog/2017-09-26-react-v16.0.md

@ -197,12 +197,11 @@ ReactDOM.render(
);
```
React also depends on `requestAnimationFrame` (even in test environments). A simple shim for test 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';
```
## Acknowledgments

Loading…
Cancel
Save