Spaces:
Paused
Super Idiot Chat Bot
import React, { useState } from 'expo';
import { View, Image, TouchableOpacity, Text } from 'expo-ui-kit';
import * as FileSystem from 'react-native-fs';
const QRCode = ({ navigation }) => {
const [qrImage, setQrImage] = useState(null);
const [savedImage, setSavedImage] = useState(false);
const handleSaveButtonPress = async () => {
if (qrImage) {
try {
const filePath = ${FileSystem.documentDirectory}/qr_code.jpg
;
const fileUri = file://${filePath}
;
const blob = new Blob([qrImage], { type: 'image/jpeg' });
await FileSystem.writeFile(filePath, blob);
setSavedImage(true);
} catch (e) {
console.error(e);
}
}
};
return (
);
};
export default QRCode;
see in this code you are using blob but did not mention from where it is coming and one major mistake you have imported the React and useState from expo come on are you mad they belong to purely React how they come from expo have you lost it
Not sure we can do much here, sorry.