react-image-resizer
react-image-resizer
is a React component that resizes the image to be nice.Installation
# use npm
$ npm install -D react-image-resizer
# use yarn
$ yarn add -D react-image-resizer
Usage
import React from 'react';
import Image from 'react-image-resizer';
class App extends React.Component {
render() {
return (
<div>
<Image
src="path/to/image.jpg"
height={ /*resize height*/ }
width={ /*resize width*/ }
/>
</div>
);
}
}
Examples
<Image
src="path/to/image.jpg"
width={240}
height={240}
style={style.image}
/>
const style = {
image: {
border: '1px solid #ccc',
background: '#fefefe',
},
};
Horizontally long case | Vertically long case | disable image :---:|:---:|:---:


