Use blueimp-load-image in React
npm install load-image-react
import { Image } from "load-image-react";
const SomeComponent = () => {
return (
<>
<h2>My Image</h2>
<Image
src="some-image-url.png"
loadOptions={{
downsamplingRatio: 0.5,
maxWidth: 200,
maxHeight: 200
}}
/>
</>
);
};
The loadOptions
prop is passed into blueimp-load-image. canvas
and orientation
will always be set to true
.
Made with 💖 by NewOrbit in Oxfordshire, and licensed under the MIT License