Cache your React event listeners to improve performance.
Charles Stover
2K24

I think in this case a function that returns a function would be a bit cleaner?

createAlertBox = (message) => () => {    alert(message);  };

And you could call it as such

<Button onClick={this.createAlertBox(listItem.text)} />
Like what you read? Give Ted Chen a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.