I was reviewing a code there user have done something like this
<temp onClick={this.onSelected} />
where onSelected looks like this
onSelected = (id: string) => {
[...]
}
How is id: string passed here?
Also, out of curiosity (not primary function). what will be the difference between
onClick={() => this.onSelected()}
and
onClick={this.onSelected}