Got this error after upgrading to React when I ran my Jest unit tests:
React depends on requestAnimationFrame. Make sure that you load a polyfill in older browsers.
How do I fix it?
I'm using Jest 18.1.0.
Got this error after upgrading to React when I ran my Jest unit tests:
React depends on requestAnimationFrame. Make sure that you load a polyfill in older browsers.
How do I fix it?
I'm using Jest 18.1.0.
Found a workaround!
Steps:
__mocks__/react.js
__mocks__/react.js
As marked on comments on the code
This is the solution from https://github.com/facebook/react/issues/9102#issuecomment-283873039
this worked for me:
raf
npm install --saveDev raf
oryarn add -D raf
setupFiles
in yourjest
config inpackage.json
like this:'setupFiles': ['raf/polyfill']
Note: if you have other setup files in this array, you may want to put
raf/polyfill
first.