I am trying to set a Blob
value when using useState(Blob)
it's not working -,-
Tried to use null
or String
or just leave it blank, It is the same issue.
import * as ImagePicker from 'expo-image-picker';import Blob from 'buffer';const [uploaded, setUploaded] = useState(false);const [video, setVideo] = useState(Blob);const uploadMedia = async () => { if (uploaded) return; let result = await ImagePicker.launchImageLibraryAsync({ mediaTypes: ImagePicker.MediaTypeOptions.Videos, allowsEditing: true, aspect: [4, 3], quality: 0, }); if (!result.cancelled) { const response = await fetch(result.uri); const blob = await response.blob(); setVideo(blob); /* < Argument of type 'Blob' is not assignable to parameter of type 'SetStateAction<typeof import("buffer")>' */ }};
Any ideas?