Answer the question
In order to leave comments, you need to log in
React.js: Why doesn't click fire?
Here is the code:
return brandName.map(function (item, i) {
return (<li onClick={this.check} key={i}><a href="#">{item}</a></li>);
}.bind(this));
Answer the question
In order to leave comments, you need to log in
onClick should be placed on a link, i.e. on "a"
return brandName.map(function (item, i) {
return (<li key={i}><a onClick={this.check} href="#">{item}</a></li>);
}.bind(this));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question