Dan Abramov
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
4 deletions
-
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 |
|
|
|