We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 749987f commit 322f299Copy full SHA for 322f299
src/index.tsx
@@ -43,17 +43,11 @@ export class ProgressiveImage extends React.Component<ProgressiveImageProps & Di
43
;
44
}
45
46
- private fetch(uri: string): Promise<string> {
+ private fetch(src: string): Promise<string> {
47
return new Promise(resolve => {
48
- fetch(uri)
49
- .then(response => response.blob())
50
- .then(blob => {
51
- const fp = new FileReader();
52
- fp.onload = () => {
53
- resolve(fp.result as string);
54
- };
55
- fp.readAsDataURL(blob);
56
- });
+ const image = new Image();
+ image.src = src;
+ image.addEventListener("load", () => resolve(src), false);
57
});
58
59
0 commit comments