Ted Chen
1 min readSep 11, 2018

--

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)} />

--

--