Image can support HTTP-Verb, Headers or a Body along with the image request. The image loader may need to be implemented using XMLHttpRequest.
https://facebook.github.io/react-native/docs/images#network-requests-for-images
Below is some detail on additional functionality this would fix (from https://github.com/necolas/react-native-web/issues/1080 by @brunolemos). I don't think it's possible using new Image() loading but should be straightforward with XMLHttpRequest loading:
xhr.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
src = xhr.responseURL;
}
};
When using an Image URI that redirects to another one, the image is not rendered.
// does not work:
<Image source={{ uri: 'https://twitter.com/brunolemos/profile_image?size=original', width: 100, height: 100 }} />;
// works fine:
<Image source={{ uri: 'https://pbs.twimg.com/profile_images/1029249022903676928/GgKLxkT4.jpg', width: 100, height: 100 }} />;
HTTP redirect should also work on web since it works on mobile
Environment (include versions). Did this work in previous versions?
Hey guys, any update on this one?
Most helpful comment
Below is some detail on additional functionality this would fix (from https://github.com/necolas/react-native-web/issues/1080 by @brunolemos). I don't think it's possible using
new Image()loading but should be straightforward withXMLHttpRequestloading:The problem
When using an Image URI that redirects to another one, the image is not rendered.
How to reproduce
Expected behavior
HTTP redirect should also work on web since it works on mobile
Environment (include versions). Did this work in previous versions?
Screenshots