React Image Grid Gallery v3 Release
React Image Grid Gallery version 3 is out! đŸ¥³
Let’s discuss the highlights.
Breaking Changes
This release comes with one (1) breaking change.
- A unique
id
property is now required for each item in theimagesArray
.
Other Notable Changes
- Full compatibility with React 19.
- Two (2) new optional props:
fixedCaption
andcustomStyles
.
Props | Type | Default | Description |
---|---|---|---|
| boolean | false | (Optional) Specify whether to display the image captions permanently ( |
| ImageGalleryStylesType |
| (Optional) Custom styles to override the following element’s default styles:
|
How to Update the React Image Grid Gallery Package
Here are the steps required to upgrade to the latest version:
-
Install the latest version
Alternatively, you can use Yarn or pnpm like so:
-
Update the
imagesArray
Add a unique
id
property to each item in theimagesArray
like so:
Note for Docusaurus Users
Suppose you used the Crypto API to generate your id
. In that case, wrap the ImageGallery
component in <BrowserOnly>
if you get a ReferenceError: crypto is not defined
error during your build step.
Example:
This process is essential if your imagesArray
uses the Web Crypto API. The <BrowserOnly>
component tells Docusaurus to render the ImageGallery
library only in the browser. It ensures that the Crypto API runs only in CSR (Client-Side Rendering) rather than during build or SSR (Server-Side Rendering).
How to Use the React Image Grid Gallery Package
See the complete project-based guide to learn how to add the ImageGallery
package to your React applications. You can use the library with Vite, NextJS, Remix, or any other React app.