react-native-image-base64
react-native-image-base64 copied to clipboard
What is my error? TypeError: null is not an object
This is my code:
import ImgToBase64 from 'react-native-image-base64';
sendData = async (uri) => {
ImgToBase64.getBase64String(uri)
.then(base64String => {
console.log(base64String)
})
.catch(err => console.log("Error Occured", err));
}
someFunction = async () => {
...function content...
this.sendData(result.uri) //here result.uri is the path to that image i.e file://...
}
With this, I am getting an error saying "TypeError: null is not an object". Please solve my error Thanks!
Same
same error
React-native: v0.64.3 react-native-image-base64: v0.1.4 expo: ~44.0.0
[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeImageBase.default.getBase64String')]
same any solution ?
@iamtheretronerd I didn't find any solution for react-native-image-base64 but you can use expo-file-system
import * as FileSystem from 'expo-file-system';
const getBase64 = async (path) => {
await FileSystem.readAsStringAsync(path, { encoding: 'base64' })
.then(base64 => console.log(base44))
.catch(err => console.log(err))
}
this guy is fucking right trust him ( in my opinion )