-
Notifications
You must be signed in to change notification settings - Fork 126
Thumbnail doesn't change when provided id changes #143
Comments
I have this problem with the FileSize component. For FileSize, the problem is that it only rerenders when the size state is changed. However, the size state is only set once in the constructor. I hacked around this by giving giving my FileSize component a prop: |
why would a file's size ever change? that seems very odd, and I've never personally run into this before |
...unless you were referring to images that are scaled by Fine Uploader just before they are uploaded. If that is the case, it would have been helpful to mention. |
If you want to fix the thumbnail issue you are having, a pull request that redraws in |
The size of a file doesn't change, but the file id does. I'm using the FileInput component to allow the user to select one file. I'm using the statusChange callback to detect when a new file id is submitted. When this occurs, I call fineUploader.methods.cancel(oldId). Then, I rerender the FileInput with the new id. |
My above suggestion should fix this too then. |
I'm using the separate components of the react-fine-uploader package to build my desired behavior.
I use the component to display a large Thumbnail of a selected image:
<Thumbnail id={this.state.selectedImage} uploader={uploader} maxSize={250} />
The state gets updated when the user clicks on a smaller version of the thumbnail, so the component re-renders. However, the displayed large thumbnail stays the same even when this.state.selectedImage changes.
The text was updated successfully, but these errors were encountered: