Home > Mobile >  How to set FA icon as a button, React
How to set FA icon as a button, React

Time:06-01

Using React, free FA icons

I want FA icon as a button, how can I do that? My effort: <button onClick={handleLogout}><FontAwesomeIcon className="logouticon" icon={faArrowRightFromBracket} color="white" /></button> But it is not working, because the icon is behind the blank default button design.

CodePudding user response:

If you only want to use button for on click event. Then you can remove it and add on click to fa icon

<FontAwesomeIcon className="logouticon" icon={faArrowRightFromBracket} color="white" onClick={handleLogout} />
  • Related