react-photo-gallery v8.0.0 Release Notes
Release Date: 2019-07-01 // over 5 years ago-
- Gallery uses React.memo
- 👉 Use hooks
- ⚡️ Update examples
- ⚡️ Update tests
- ⬆️ Bump default limitNodeSearch to 2
- 🔄 Change the way renderImage works. You now need to pass in your own key. The component is no longer wrapped in a div with a key.
Possible breaking changes
- ⚠ if your are using a custom component (renderImage prop), you may get a warning about keys. It could also stop interacting correctly with other libraries that use an HOC.
- ⚡️ the Gallery uses React.memo. That means it does a shallow update of props. If you are mutating your photos array directly, it will no longer trigger a change. You will need to make sure your prop values are immutable if you want them to trigger Gallery updates.
Previous changes from v7.0.0
-
💥 Breaking Changes
- 🆕 New algorithm being used which ignores
columns
prop whendirection=row
(default). Photos per row are now determined by the new algorithm keeping in mind the user definedtargetRowHeight
. - ImageComponent renamed to
renderImage
targetRowHeight
. New prop. The algorithm will do its best to keep rows close to this heightlimitNodeSearch
. New prop. Limits the amount of neighboring nodes to check for the best row
- 🆕 New algorithm being used which ignores