title: How to insert a checkmark in the list in React?
body: <p>I was working on a ReactJS project. I was trying to display a list of cities, where the list elements are selectable. And when we select a list element, I should display a checkmark at the end of it. I did the display part, but I was not able to insert a checkmark. This checkmark should be there until we deselect it. Can anyone help to solve this issue of inserting a checkmark?</p>
  
  <pre><code>function NonIdiomaticList(props) {
    let array = [];
    for(let i = 0; i &lt; props.items.length; i++) {
      array.push(
        &lt;Item key={i} isSelectable item={props.items[i]} /&gt;
      );
    }
  
  </code></pre>