I have a set of components being rendered from a .map() function in my React application.
I have a function that fires on element's onClick which works great. However, I also need to fire this function automatically on a specific element when the page loads.
Here's a rather rudimentary example: https://codesandbox.io/s/ecstatic-cartwright-ve84yt.
So in the example, I have an array of 5 names, when you click the card, the field at the bottom displays the name of the selected card.
What I'm trying is to pre-select (Without using setState's initial value) one of the cards.