digidem / react-dimensions

[Looking for maintainers]
http://lab.digital-democracy.org/react-dimensions/
450 stars 77 forks source link

Fallback when requestAnimationFrame is unavailable #49

Closed beheh closed 8 years ago

beheh commented 8 years ago

Some browsers visiting my site do not seem to support requestAnimationFrame - e.g. an extremely outdated Chrome 23. While I do not really want to support these browsers it should be easy enough to just manually execute the wrapped function if window.requestAnimationFrame is undefined.

gmaclennan commented 8 years ago

Use a polyfill. Lots of options. One here: https://polyfill.io/v2/docs/

beheh commented 8 years ago

Good point, thanks!

hustcc commented 6 years ago

Add polyfill is not the best method to fixed window.requestAnimationFrame is undefined.

Because of babel 6 add use strict by default. add plugin transform-remove-strict-mode will be ok.

https://github.com/KyleAMathews/element-resize-event/issues/29