Closed rjohnep closed 7 years ago
Hi @afram could you consider this? Thanks.
@rjohnep @nguymin4 You can already do this.
The horizontalOrder property is a Masonry option, you can just add it to your existing Masonry options.
I have also added the option to the TypeScript interface and bumped the min version of masonry-layout to 4.2.0 - It shouldn't make a difference for you unless you are using TypeScript.
I'm going to close this issue. Please reopen if needed.
Here's an example on how you'd use horizontalOrder
.
import React from 'react'
import Masonry from 'react-masonry-component';
const masonryOptions = {
transitionDuration: 0,
horizontalOrder: true
};
class Gallery extends React.Component {
render() {
const childElements = this.props.elements.map(function(element){
return (
<li className="image-element-class">
<img src={element.src} />
</li>
);
});
return (
<Masonry options={masonryOptions}>
{childElements}
</Masonry>
);
}
};
Should add that v5.0.7 has been released with the changes mentioned above.
Hi @afram, checked the latest release and doesn't appear to be there. Any chance of adding this in?
Hi @eirikl, Can you update dependencies for 'masonry-layout' (4.2.0) and add 'horizontalOrder' option? Thanks.