From v0.5.x
September 13, 2022 ยท View on GitHub
The biggest change from v0.5.x to 1.x.x is that now this library has no lightbox functionality. Read this discussion to learn more about the motivation for that decision. So if you need lightbox integration please check out our examples.
API changes
Also, we made API polishing and renamed some props, and changed event handler signatures.
Gallery Options changes
onSelectImagerenamed toonSelectonClickThumbnailrenamed toonClick
Both event handlers now receive the same arguments:
(index: number, item: Image, event: MouseEvent<HTMLElement>) => void
Styling props such as thumbnailStyle, tagStyle, tileViewportStyle now get some extra data as arguments, read more in the docs.
In v0.5.x, there was hacky access to this in event handlers.
After lightbox functionality was stripped out this hack was removed as well.
Image Options changes
thumbnailrenamed tosrcthumbnailWidthrenamed towidththumbnailHeightrenamed toheight
So now the minimum image object looks like this
{
"src": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Apples.jpg/320px-Apples.jpg",
"width": 320,
"height": 480
}
No default import
React grid gallery now uses only named export. Please update import to
import { Gallery } from "react-grid-gallery";