2021年4月22日星期四

FontAwesome icon onClick() event doesn’t work as expected

I am using the Font Awesome in my reach app. I have added the required dependencies and imported them. The icons show up, unfortunately, when I click the icon directly, nothing happens. Does anyone know why this happens, and how to fix it?

clearHandler = (e) => {      e.preventDefault();  }
<FontAwesomeIcon      icon={['far', 'times-circle']}      aria-hidden="true"      onClick={this.clearHandler}      className={styles.clearButton}  />
https://stackoverflow.com/questions/67210130/fontawesome-icon-onclick-event-doesn-t-work-as-expected April 22, 2021 at 05:03PM

没有评论:

发表评论