react-strapi-img is a wrapper for images, that handles responsive sizes, lazyloading and loading-animation. It is built to consume the image-data from Strapi.
The react-strapi-img library is a wrapper for img that handles webp-support, responsive sizes, lazyloading, and loading animation. It is optimized to consume image data from Strapi, but can also be useful in other contexts. However, it is important to note that this library is still in beta-state and its API may change without warning.
To install the react-strapi-img library, follow these steps:
Install the required peer dependencies:
Setup image-resizing in Strapi by copying the “services” folder from the library to the Strapi-folder /extensions/upload. This allows the library to resize every uploaded image, including:
Fetch the image with GraphQL in your React component and use it with the react-strapi-img library.
The react-strapi-img library is a feature-rich wrapper for img that handles webp-support, responsive sizes, lazyloading, and loading animation. It is specifically designed to consume image data from Strapi, but can be used in other contexts as well. It offers a wide range of features to enhance image loading and performance, making it a valuable tool for developers working with image-heavy applications. However, it is important to note that the library is currently in beta-state and its API may change in the future.