Skip to content
Snippets Groups Projects
Commit a3f038ca authored by Taneli Riihimäki's avatar Taneli Riihimäki
Browse files

Refactored a loop to be a bit simpler

parent 3c7a6002
No related branches found
No related tags found
1 merge request!46Development to testing
...@@ -70,15 +70,11 @@ class TaskItem extends React.Component { ...@@ -70,15 +70,11 @@ class TaskItem extends React.Component {
}; };
render() { render() {
let factionlistItems = []; let factionlistItems = this.state.factions.map(faction => (
for (let i = 0; i < this.state.factions.length; i++) { <option key={faction.factionId} value={faction.factionId}>
const faction = this.state.factions[i]; {faction.factionName}
factionlistItems.push( </option>
<option key={faction.factionId} value={faction.factionId}> ));
{faction.factionName}
</option>
);
}
return ( return (
<div className="tasklist-item"> <div className="tasklist-item">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment