react-images-upload icon indicating copy to clipboard operation
react-images-upload copied to clipboard

Early return in componentWillReceiveProps if singleImage is true

Open armanrozika opened this issue 5 years ago • 1 comments

The case: let say we are editing a post content. We want to show a default image from a url received from database, and we want to change image preview if user choose an image (change the image).

The current implementation, componentWillreceiveProps will always invoked when onChange is fired because defaultImages is a primitive (array). This makes image preview won't change.

With singleImage props being true, we want to preview the selected image, not the default one, if user is going to change image.

Thank you

armanrozika avatar Jun 14 '20 08:06 armanrozika

@JakeHartnell What do you think about this?

armanrozika avatar Jun 18 '20 12:06 armanrozika