I am having the following error in react-native:
[Unhandled promise rejection: ReferenceError: Can't find variable: Image]
* src/utils/b64ToBlob.js:45:56 in Promise$argument_0
And this is the function where it fail in b64ToBlog.js
:
export const getImageDimensions = (file) => new Promise((resolved) => {
const i = new Image();
i.onload = () => resolved(i);
i.src = file;
});
On both iOS
and Android
, it fails on const i = new Image();
:
How can I provide Image
or get an image dimensions from an URL or how can I provide Image
in react-native?