Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

migrate string-refs in user_list.jsx #6704

Merged
11 changes: 8 additions & 3 deletions components/user_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ export default class UserList extends React.PureComponent {
rowComponentType: UserListRow,
}

constructor(props) {
super(props);
this.container = React.createRef();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename this to match what we are doing in other PRs

Suggested change
this.container = React.createRef();
this.containerRef = React.createRef();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay @Willyfrog

}

scrollToTop = () => {
if (this.refs.container) {
this.refs.container.scrollTop = 0;
if (this.container.current) {
this.container.current.scrollTop = 0;
}
}

Expand Down Expand Up @@ -80,7 +85,7 @@ export default class UserList extends React.PureComponent {
}

return (
<div ref='container'>
<div ref={this.container}>
{content}
</div>
);
Expand Down