react React - passing a value with onClick I ran into an issue where I had a list of items being rendered and wanted to trigger an action if one of them was clicked. For instance consider this component that renders a list of items. It creates an li for each item.