react-optimized-image icon indicating copy to clipboard operation
react-optimized-image copied to clipboard

What are the benefits of this package?

Open kopax opened this issue 4 years ago • 3 comments

Hello and sorry if it sounds dumb, I am reading the README.md on npmjs and it starts with:

  • Optimize images using WebAssembly (runs in every environment)
  • React components for different use-cases (responsive images, WebP conversion, lazy loading placeholders, image manipulation, ...)
  • Build cache for images for faster builds
  • Convert to WebP automatically during a webpack build
  • Inline small images automatically

I then see that it depend on optimized-images-loader which I also read.

It seems that most of those features are possible with it. I am using react, what is the major addition you have made with optimized images loader ?

I have tried to configure the plugin but I am stuck with https://github.com/cyrilwanner/optimized-images-loader/issues/23, all my images now look like:

image

kopax avatar Dec 26 '20 21:12 kopax

Same question, it is unclear the benefits of the library would bring.

santaclauze avatar Jan 09 '21 20:01 santaclauze

From my understanding, react-optimized-image acts as a wrapper to simplify the use of optimized-images-loader (or next-optimized-images).

For example, with just optimized-images-loader you'd have to do this:

<img src={require('./images/my-small-image.png?webp')} />

With react-optimized-image you can do:

<Img src={require('./images/my-small-image.png')} webp />

As mentioned, this library is a wrapper that provides a component for convenient use of optimized-images-loader (for React) or next-optimized-images (for NextJS). You STILL NEED ONE OF THOSE for this library to work as expected.

EliteMasterEric avatar Feb 20 '21 04:02 EliteMasterEric

Hi, It works with dynamic images or just with local images saved on the disk?

Mihai-github avatar Oct 27 '21 08:10 Mihai-github