-1

I'm using the react-native-compression package for compressing the files, but while using it I'm having an error.

error message

and here is the code where I'm adding the Image compressor:

code where using compressors

I'm getting the file URL while uploading but still it is giving me an error. so please let me know how to handle this error.

1 Answers1

0

Image. compress(params..) is asynchronous function which returns a promise, and should not be executed inside JSX.

More about React and Asynchronous programming - https://medium.com/capbase-engineering/asynchronous-functional-programming-using-react-hooks-e51a748e6869

Fiston Emmanuel
  • 4,242
  • 1
  • 8
  • 14