How to use React Props w/ uppy along with Formik for AWS Upload

Hey,

I am using uppy as an upload component and I want to pass props to it and refresh the values of those props when the value in the parent component changes.

My current setup is like this

Since I am using Formik I am using the setFieldValue() to set the value after the file is uploaded and it is working, since S3 supports versioning I am trying to reset the filename to a new filename or the previous filename which was assigned. The new filename is working but I am not able to retrieve the values using props from the parent component to set the previous assigned filename.

The constructor is showing the initial values itself every time i upload something while the actual values are getting updated.

How do i solve it and make it take the actual prop values.

Thanks,

  • Nithin

Hello there! First off, for class components, you should also include

 componentWillUnmount () {
    this.uppy.close()
  }

In your component.

Also, getOldFileName isn’t an async function (unless _.get returns a promise), and you’re calling it with await.

As for the issue that you’re reporting, I can’t be too sure of your error. Is there any sort of log output that you can send?

In the meantime, I’ll keep looking through the code and see if I can find any other issues

- Andrew