ReactJS: List of Numbers with Index

This entry is part 6 of 35 in the series React JS

https://codepen.io/gaearon/pen/jrXYRR?editors=0011

function NumberList(props) {
  const numbers = props.numbers;
  const listItems = numbers.map((number) =>
    <li key={number.toString()}>
      {number}
    </li>
  );
  return (
    <ul>{listItems}</ul>
  );
}

const numbers = [1, 2, 3, 4, 5];
ReactDOM.render(
  <NumberList numbers={numbers} />,
  document.getElementById('root')
);
Series Navigation<< ReactJS: Drop Down Submit Form
ReactJS: Toggle On Off button >>