React Image Grid Gallery v2 Release
React Image Grid Gallery version 2 is out! š„³
Letās discuss the highlights.
Breaking Changes
This release comes with two breaking changes.
- Replace default
import
with namedimport
. This change provides better compatibility with Node and Babel-like tools. - Rename
imgArray
prop toimagesInfoArray
.
Other Changes
- Change compiler from Babel to TypeScript.
- Remove Babel dependency.
- Replace
uniqid
dependency withcrypto.randomUUID
. - Convert all configuration files to TypeScript.
- Replace external CSS with inline styling.
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 packageās
import
syntaxReplace the packageās default
import
statement with the namedimport
syntax like so: -
Update the packageās props
Update the required propās name as follows:
Note for Docusaurus Users
Wrap the ImageGallery
component in <BrowserOnly>
if you get a ReferenceError: crypto is not defined
error during your build step.
Example:
The <BrowserOnly>
component tells Docusaurus to render the ImageGallery
library only in the browser.
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.