socialtables / react-image-fallback

stop displaying broken images, have another image to fallback on.
111 stars 18 forks source link

`window.Image` instead of bare `Image` #28

Closed mheiber closed 8 years ago

mheiber commented 8 years ago

helps my tests pass when using virtual-dom without an awkward workaround

conorhastings commented 8 years ago

@mheiber how is this effecting your test?

mheiber commented 8 years ago

@conorhastings

Uncaught ReferenceError: Image is not defined at new ReactImageFallback (node_modules/react-image-fallback/lib/index.js:31:28)

Here's the workaround I'm using, which I hope to be able to get rid of:

In the before in our Mocha tests: global.Image = window.Image In the after in our Mocha tests: delete global.Image

Not the end of 🌏 , but it'll be less dirty without that stuff.

By the way, I love what you're doing with this library. Image fallbacks are almost need-to-have, in my opinion, not just a nice touch.

conorhastings commented 8 years ago

@mheiber published as 2.4.1