question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReactJS Uppy - Show images in Uppy Dashbaord after state changes

See original GitHub issue

Hello
Uppy is working well with file uploading but Images are going to disappear when state changed, so is there any way to preserve image after upload. I found a very useful link on stackoverflow.com, I have the same problem. Please check this https://stackoverflow.com/questions/60201146/uppy-control-remove-uploaded-file-when-state-is-change

Unfortunately there are no answer, any help

Thanks in advance!!

import Uppy from '@uppy/core'
import XHRUpload from '@uppy/xhr-upload'
import Webcam from '@uppy/webcam'  
import { DragDrop, Dashboard } from '@uppy/react'  
  
import 'uppy/dist/uppy.css'
import '@uppy/status-bar/dist/style.css'
import '@styles/react/libs/file-uploader/file-uploader.scss'

const equipment_uppy = new Uppy({
      id: 'equipment_uppy',
      restrictions: { allowedFileTypes: ['image/*', 'video/*'] },
      autoProceed: false
    })
   
    equipment_uppy.on('file-added', (file) => {
      equipment_uppy.setFileMeta(file.id, {
        type: file.source,
        avintakeid : data.id
      })
    })
   
    equipment_uppy.use(XHRUpload, {
    endpoint: `${process.env.REACT_APP_SITE_URL}/api/auth/uploadavintakeimages`,
    formData: true,
    fieldName: 'files[]',
    headers: {
     Authorization: `Bearer ${localStorage.getItem('accessToken')}`
    }})
    
    equipment_uppy.use(Webcam)

<Dashboard   
uppy={equipment_uppy}  
id='equipment_location_image'
width='100%'
height='300px'
plugins={['Webcam']}
/>`

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dharmdeepcommented, Sep 13, 2021

Thanks a lot its worked for me by installing latest version & correct initialize for react.

0reactions
Murderloncommented, Sep 10, 2021

Here is an example of the dashboard with react and state changes in the component. When used correctly, the dashboard stays the same even though the component re-renders.

Note: this example uses the latest major release. You are quite some versions behind.

https://codesandbox.io/s/kind-kare-vjzsd?file=/src/App.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Show images in uppy dashboard after state changes
Save this question. Show activity on this post. I am using Uppy Dashboard and whenever the state changes uppy reset its state and...
Read more >
Dashboard - Uppy
Image previews; Metadata editor; Upload progress; Ability to pause or cancel (depending on the uploader plugin) uploads. import ...
Read more >
Uppy Image Editor shows 2 editable images instead of one
I'm using @uppy/image-editor and seeing two images that are both editable (only changes to the image on the right actually seem to be...
Read more >
[Solved]-Slider won't show images in ReactJS-Reactjs
Show images in a Reactjs page only when a variable has a particular value · ReactJS Uppy - Show images in uppy dashboard...
Read more >
Uppy (@uppy_io) / Twitter
Uppy adds files from local disk, Instagram, Unsplash (and more) crops images, records audio and screencasts, adapts to your desktop and mobile UI, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found