class App extends React.Component{
state = {
title: 'List',
arr: [
'simon','dima','kosty'
]
}
ren = ({target}) => {
alert(target.textContent);
}
render(){
return(
<div>
<h1>{this.state.title}</h1>
<ol>
{this.state.arr.map(
(list, key) =>
<li onClick={this.ren} key={key}>{list}</li>
)}
</ol>
</div>
);
}
}
ReactDOM.render(
<App />,
document.getElementById('root')
);