From 30ff7eed55d3a671226a5c7fdbbf6ee8ac13eb38 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 13 Nov 2017 22:09:46 +0000 Subject: [PATCH] Suggest raf package in the blog post (#284) --- content/blog/2017-09-26-react-v16.0.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/content/blog/2017-09-26-react-v16.0.md b/content/blog/2017-09-26-react-v16.0.md index 49fcd35d..31f52d3b 100644 --- a/content/blog/2017-09-26-react-v16.0.md +++ b/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