react-image-magnify
react-image-magnify copied to clipboard
How to keep the largeImage aspect ratio same as original.
I want to keep the aspect ratio of different images to their original aspect ration.
<ReactImageMagnify {...{ smallImage: { alt: 'Wristwatch by Ted Baker London', isFluidWidth: true, src: this.state.currentImage.fluid.src, sizes: '(max-width: 480px) 100vw, (max-width: 1200px) 30vw, 360px', srcSet: this.state.currentImage.fluid.srcSet }, largeImage: { src: this.state.currentImage.fluid.src, srcSet: this.state.currentImage.fluid.srcSet, width: 600, height: 800 }, isHintEnabled: true, shouldHideHintAfterFirstActivation: false }} />
I have same problem
same problem here!
same problem!
You can try this:
enlargedImageStyle: {
objectFit: 'contain',
},