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] !== '#') { if (!tab.channel || tab.channel[0] !== '#') {
style.display = 'none'; style.display = 'none';
} else { } else {
users = this.state.users.map(user => { this.state.users.forEach(user => {
return <UserListItem key={user.nick} user={user} />; users.push(<UserListItem key={user.nick} user={user} />);
}).toArray(); // React Infinite uses .length });
} }
if (users.length > 1) { if (users.length > 1) {

File diff suppressed because one or more lines are too long