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.
Also, we made API polishing and renamed some props, and changed event handler signatures.
onSelectImagerenamed toonSelectonClickThumbnailrenamed toonClick
Both event handlers now receive the same arguments:
(index: number, item: Image, event: MouseEvent<HTMLElement>) => voidStyling 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.
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
}React grid gallery now uses only named export. Please update import to
import { Gallery } from "react-grid-gallery";