avishayil / react-native-user-avatar

Avatar Component For React Native
MIT License
206 stars 57 forks source link

[web] Images with specific CORS headers give false negative #89

Closed walidvb closed 2 years ago

walidvb commented 3 years ago

I'm loading images from gravatar, and it seems that using the fetch API returns an error, even though the image would be correctly loaded by the browser.

I'll try and make a PR to address this, by changing the behaviour on web, along the lines of:

 const image = document.createElement('img');

  image.onload = setImageWorked;
  image.onerror = doUseFallback;
  image.referrerPolicy = 'no-referrer';
  image.src = src;
avishayil commented 2 years ago

Should be fixed with v1.0.8