Open eiriklv opened 9 years ago
+1, especially now that Mixins are out
@cassidoo
Shouldn't be too much work, and it would look a lot nicer with something like this:
var React = require('react');
var Masonry = require('react-masonry-component')(React);
var masonryOptions = {
transitionDuration: 0
};
var Gallery = React.createClass({
render: function () {
var images = this.props.elements.map(function(element){
return (
<div className="someclass">
<img src="element.src" />
</div>
);
});
return (
<Masonry options={masonryOptions}>
{images}
</Masonry>
);
}
});
module.exports = Gallery;
You would just need to be able to specify what type of element the <Masonry>
component should default to and be able to override it, just like <CSSTransitionGroup>
.
+1
Oh cool will give that a try, thanks!
Follow the same principals as FluxComponent from flummox