Avoid array conversion in UserList

This commit is contained in:
Ken-Håvard Lieng 2015-05-23 01:30:09 +02:00
parent 6a6aedc5da
commit 9b9bef3695
2 changed files with 11 additions and 11 deletions

View File

@ -58,9 +58,9 @@ var UserList = React.createClass({
if (!tab.channel || tab.channel[0] !== '#') {
style.display = 'none';
} else {
users = this.state.users.map(user => {
return <UserListItem key={user.nick} user={user} />;
}).toArray(); // React Infinite uses .length
this.state.users.forEach(user => {
users.push(<UserListItem key={user.nick} user={user} />);
});
}
if (users.length > 1) {

File diff suppressed because one or more lines are too long