-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dynamically measured images example #1081
Conversation
Fixed it in the demo, |
docs/Masonry.md
Outdated
|
||
const MasonryComponent = ({ itemsWithSizes }) => { | ||
// Default sizes help Masonry decide how many images to batch-measure | ||
const cache = new CellMeasurerCache({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be created within the MasonryComponent
component because that would mean it gets recreated each time.
docs/Masonry.md
Outdated
}); | ||
|
||
// Our masonry layout will use 3 columns with a 10px gutter between | ||
const cellPositioner = createMasonryCellPositioner({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be created within the MasonryComponent
component because that would mean it gets recreated each time.
Fixed in docs too. |
Ill take a look later when I have time. But so far it looks good! |
@wuweiweiwu awesome! Glad to hear that. |
Awesome, the demo seems to have been fixed! Thanks for contributing! |
Great! Thanks! |
Fixes #979
This pull request adds a small demo with masonry and images of unknown size which are measured in runtime.