When using FileReader readAsDataURL it does not load blob file, no error
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.3k
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 4
Descripción
Description
When I run this code below the load event does not print the log and therefore the blob file is not being converted into a uri.
`if (messageModel.item.image) {
console.log(messageModel.item.id, "has image");
const imgBlob = messageModel.item.image;
let reader = new FileReader();
reader.addEventListener(
"load",
() => {
console.log("loaded");
},
false
);
reader.readAsDataURL(imgBlob);
}`
React Native Version
0.71.0
Output of npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 13.4.1
CPU: (10) arm64 Apple M1 Max
Memory: 325.55 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.15.0 - /usr/local/bin/node
Yarn: 3.4.1 - /usr/local/bin/yarn
npm: 9.5.0 - /usr/local/bin/npm
Watchman: 2023.06.12.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.0 - /Users/davidchoi/.rvm/rubies/ruby-2.7.6/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.6 => 0.71.6
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
info React Native v0.72.1 is now available (your project is running on v0.71.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.72.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.71.6
info For more info, check out "https://reactnative.dev/docs/upgrading".
Steps to reproduce
Simply running the code I showed in a expo 48 app will do it. But you can also look at my repo if you want.
Snack, code example, screenshot, or link to a repository
This is the repo, https://github.com/jsoneaday/learn-react-native-fast. Code is in section_3/chatter
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Reproduce el problema en el ejemplo section_3/chatter del repositorio enlazado, comenzando por la llamada readAsDataURL de FileReader y su listener de load. Compara el comportamiento en la configuración indicada de React Native 0.71.6 y Expo 48, y luego identifica una reproducción o prueba específica que demuestre la conversión esperada del blob y el evento load.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, react-native
- Área
- mobile
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100