title: Click on React list of elements and store it as a value in another list
body: <p>I have this sample code which is a search input that filters and returns different colors in a list. When you click on one of the items the innerHTML from that list item then populates the value in the input field.</p>
  
  <p>My question is when I click on one of the list items, I would want to get that specific list item and store it in another list. Much like a search history. Is this difficult to add to the current state of the search field? How would you suggest that I'd approach this?</p>
  
  <p>Do i need to have some kind of onSubmit function to achieve this?</p>
  
  <p>See this example:
  <a href="https://codesandbox.io/s/autocomplete-6lkgu" rel="nofollow noreferrer">https://codesandbox.io/s/autocomplete-6lkgu</a></p>
  
  <p>Thanks beforehand,
  Erik</p>