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

@ -21,16 +21,18 @@ const mapStateToProps = state => ({
class FollowRequests extends ImmutablePureComponent {
constructor (props, context) {
super(props, context);
this.handleScroll = this.handleScroll.bind(this);
}
static propTypes = {
params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
accountIds: ImmutablePropTypes.list,
intl: PropTypes.object.isRequired
};
componentWillMount () {
this.props.dispatch(fetchFollowRequests());
}
handleScroll (e) {
handleScroll = (e) => {
const { scrollTop, scrollHeight, clientHeight } = e.target;
if (scrollTop === scrollHeight - clientHeight) {
@ -62,13 +64,7 @@ class FollowRequests extends ImmutablePureComponent {
</Column>
);
}
}
FollowRequests.propTypes = {
params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
accountIds: ImmutablePropTypes.list,
intl: PropTypes.object.isRequired
};
export default connect(mapStateToProps)(injectIntl(FollowRequests));