0
0
Fork 0

Use ES Class Fields & Static Properties (#3008)

Use ES Class Fields & Static Properties (currently stage 2) for improve class outlook.

Added babel-plugin-transform-class-properties as a Babel plugin.
This commit is contained in:
Yamagishi Kazutoshi 2017-05-12 21:44:10 +09:00 committed by Eugen Rochko
parent 44a3584e2d
commit 2991a7cfe6
79 changed files with 838 additions and 1128 deletions

View file

@ -32,14 +32,15 @@ const scrollTop = (node) => {
class Column extends React.PureComponent {
constructor (props, context) {
super(props, context);
this.handleHeaderClick = this.handleHeaderClick.bind(this);
this.handleWheel = this.handleWheel.bind(this);
this.setRef = this.setRef.bind(this);
}
static propTypes = {
heading: PropTypes.string,
icon: PropTypes.string,
children: PropTypes.node,
active: PropTypes.bool,
hideHeadingOnMobile: PropTypes.bool
};
handleHeaderClick () {
handleHeaderClick = () => {
const scrollable = this.node.querySelector('.scrollable');
if (!scrollable) {
return;
@ -47,13 +48,13 @@ class Column extends React.PureComponent {
this._interruptScrollAnimation = scrollTop(scrollable);
}
handleWheel () {
handleWheel = () => {
if (typeof this._interruptScrollAnimation !== 'undefined') {
this._interruptScrollAnimation();
}
}
setRef (c) {
setRef = (c) => {
this.node = c;
}
@ -82,12 +83,4 @@ class Column extends React.PureComponent {
}
Column.propTypes = {
heading: PropTypes.string,
icon: PropTypes.string,
children: PropTypes.node,
active: PropTypes.bool,
hideHeadingOnMobile: PropTypes.bool
};
export default Column;