Move ref callbacks into class bound methods

This commit is contained in:
Ken-Håvard Lieng 2017-02-16 22:56:32 +01:00
parent 77b53bfc5e
commit 531792b14a
4 changed files with 28 additions and 22 deletions

View file

@ -31,6 +31,8 @@ export default class UserList extends Component {
return 24;
};
listRef = el => { this.list = el; };
handleResize = () => this.setState({ height: window.innerHeight - 100 });
renderUser = index => {
@ -65,7 +67,7 @@ export default class UserList extends Component {
return (
<div className={className} style={style}>
<VirtualScroll
ref={el => { this.list = el; }}
ref={this.listRef}
height={this.state.height}
rowsCount={this.props.users.size + 2}
rowHeight={this.getRowHeight}