react-responsive-masonry
Advanced tools
Comparing version
@@ -0,1 +1,7 @@ | ||
# 1.3.3 - 2017-09-28 | ||
* Add: custom className support | ||
* Add: single node children support | ||
* Fix: do not reset this.container | ||
# 1.2.3 - 2017-06-14 | ||
@@ -2,0 +8,0 @@ |
@@ -105,3 +105,3 @@ "use strict"; | ||
"div", | ||
{ style: styles.container }, | ||
{ style: styles.container, className: this.props.className }, | ||
this.renderColumns() | ||
@@ -116,5 +116,6 @@ ); | ||
Masonry.propTypes = { | ||
children: _propTypes2.default.array.isRequired, | ||
children: _propTypes2.default.oneOfType([_propTypes2.default.arrayOf(_propTypes2.default.node), _propTypes2.default.node]).isRequired, | ||
columnsCount: _propTypes2.default.number, | ||
gutter: _propTypes2.default.string | ||
gutter: _propTypes2.default.string, | ||
className: _propTypes2.default.string | ||
}; | ||
@@ -124,3 +125,4 @@ | ||
columnsCount: 3, | ||
gutter: "0" | ||
gutter: "0", | ||
className: null | ||
}; | ||
@@ -127,0 +129,0 @@ |
@@ -40,2 +40,3 @@ "use strict"; | ||
_this.handleResize = _this.handleResize.bind(_this); | ||
_this.handleRef = _this.handleRef.bind(_this); | ||
return _this; | ||
@@ -88,2 +89,7 @@ } | ||
}, { | ||
key: "handleRef", | ||
value: function handleRef(ref) { | ||
if (!this.container) this.container = ref; | ||
} | ||
}, { | ||
key: "render", | ||
@@ -95,5 +101,3 @@ value: function render() { | ||
"div", | ||
{ ref: function ref(_ref) { | ||
return _this2.container = _ref; | ||
} }, | ||
{ ref: this.handleRef, className: this.props.className }, | ||
_react2.default.Children.map(this.props.children, function (child, index) { | ||
@@ -113,4 +117,5 @@ return _react2.default.cloneElement(child, { | ||
MasonryResponsive.propTypes = { | ||
children: _propTypes2.default.any.isRequired, | ||
columnsCountBreakPoints: _propTypes2.default.object | ||
children: _propTypes2.default.oneOfType([_propTypes2.default.arrayOf(_propTypes2.default.node), _propTypes2.default.node]).isRequired, | ||
columnsCountBreakPoints: _propTypes2.default.object, | ||
className: _propTypes2.default.string | ||
}; | ||
@@ -123,3 +128,4 @@ | ||
900: 3 | ||
} | ||
}, | ||
className: null | ||
}; | ||
@@ -126,0 +132,0 @@ |
{ | ||
"name": "react-responsive-masonry", | ||
"version": "1.2.3", | ||
"version": "1.3.3", | ||
"description": "React responsive masonry component built with css flexbox", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
24420
6.65%220
3.77%