Skip to content

className props #232

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21106,7 +21106,9 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module,
axis = _props7.axis,
length = _props7.length,
type = _props7.type,
useTranslate3d = _props7.useTranslate3d;
useTranslate3d = _props7.useTranslate3d,
className = _props7.className,
classNameInner = _props7.classNameInner;
var _state7 = this.state,
from = _state7.from,
itemsPerRow = _state7.itemsPerRow;
Expand Down Expand Up @@ -21136,10 +21138,10 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module,
'div',
{ style: style, ref: function ref(c) {
return _this4.el = c;
} },
}, className: className },
_react2.default.createElement(
'div',
{ style: listStyle },
{ style: listStyle, className: classNameInner },
items
)
);
Expand All @@ -21162,7 +21164,9 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module,
threshold: _propTypes2.default.number,
type: _propTypes2.default.oneOf(['simple', 'variable', 'uniform']),
useStaticSize: _propTypes2.default.bool,
useTranslate3d: _propTypes2.default.bool
useTranslate3d: _propTypes2.default.bool,
className: _propTypes2.default.string,
classNameInner: _propTypes2.default.string
}, _class.defaultProps = {
axis: 'y',
itemRenderer: function itemRenderer(index, key) {
Expand All @@ -21187,7 +21191,9 @@ Cogs.define("react-list.js", function (COGS_REQUIRE, COGS_REQUIRE_ASYNC, module,
threshold: 100,
type: 'simple',
useStaticSize: false,
useTranslate3d: false
useTranslate3d: false,
className: 'ReactList',
classNameInner: 'ReactList__inner'
}, _temp);
});
});
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions react-list.es6
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ module.exports = class ReactList extends Component {
threshold: PropTypes.number,
type: PropTypes.oneOf(['simple', 'variable', 'uniform']),
useStaticSize: PropTypes.bool,
useTranslate3d: PropTypes.bool
useTranslate3d: PropTypes.bool,
className: PropTypes.string,
classNameInner: PropTypes.string
};

static defaultProps = {
Expand All @@ -93,7 +95,9 @@ module.exports = class ReactList extends Component {
threshold: 100,
type: 'simple',
useStaticSize: false,
useTranslate3d: false
useTranslate3d: false,
className: 'ReactList',
classNameInner: 'ReactList__inner'
};

constructor(props) {
Expand Down Expand Up @@ -471,7 +475,7 @@ module.exports = class ReactList extends Component {
}

render() {
const {axis, length, type, useTranslate3d} = this.props;
const {axis, length, type, useTranslate3d, className, classNameInner} = this.props;
const {from, itemsPerRow} = this.state;

const items = this.renderItems();
Expand All @@ -498,8 +502,8 @@ module.exports = class ReactList extends Component {
transform
};
return (
<div style={style} ref={c => this.el = c}>
<div style={listStyle}>{items}</div>
<div style={style} ref={c => this.el = c} className={className}>
<div style={listStyle} className={classNameInner}>{items}</div>
</div>
);
}
Expand Down
16 changes: 11 additions & 5 deletions react-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@
axis = _props7.axis,
length = _props7.length,
type = _props7.type,
useTranslate3d = _props7.useTranslate3d;
useTranslate3d = _props7.useTranslate3d,
className = _props7.className,
classNameInner = _props7.classNameInner;
var _state7 = this.state,
from = _state7.from,
itemsPerRow = _state7.itemsPerRow;
Expand Down Expand Up @@ -651,10 +653,10 @@
'div',
{ style: style, ref: function ref(c) {
return _this4.el = c;
} },
}, className: className },
_react2.default.createElement(
'div',
{ style: listStyle },
{ style: listStyle, className: classNameInner },
items
)
);
Expand All @@ -677,7 +679,9 @@
threshold: _propTypes2.default.number,
type: _propTypes2.default.oneOf(['simple', 'variable', 'uniform']),
useStaticSize: _propTypes2.default.bool,
useTranslate3d: _propTypes2.default.bool
useTranslate3d: _propTypes2.default.bool,
className: _propTypes2.default.string,
classNameInner: _propTypes2.default.string
}, _class.defaultProps = {
axis: 'y',
itemRenderer: function itemRenderer(index, key) {
Expand All @@ -702,6 +706,8 @@
threshold: 100,
type: 'simple',
useStaticSize: false,
useTranslate3d: false
useTranslate3d: false,
className: 'ReactList',
classNameInner: 'ReactList__inner'
}, _temp);
});