If you return inside a loop, then the entire function (including the loop) is going to finish executing.
The way to solve this problem is to create an array of components then return the entire array after the loop.
let { rounds, current_round } = this.props.order;
let list = [];
for (let i = current_round + 1; i < rounds + 1; i++) {
list.push(
<li>
<button id={i} key={i} className="rounds_btn">{i}</button>
</li>
);
}
return list;
However, the usual way to do this with React is to use the map function.
let { order } = this.props;
let nums = range(order.current_round + 1, order.rounds + 1);
return nums.map(i => (
<li><button key={i} id={i} className='rounds_btn'></button></li>
));
// quick range utility (could use lodash...)
function range(start, end) {
let nums = [];
for (let i = start; i < end; i++) nums.push(i);
return nums;
}
In most cases you'll already have your array (list of people, list of items, etc) and all you need to do is map each one to a React component, then return that list.
I've also added a key attribute, which React will warn you about, if you forget it for lists of components (helps with reconciling the list if you re-render it in a different order).
Also watch out for using class rather than className, because class is a reserved word in JavaScript, React chooses to use className as the JSX prop instead.