Simon
Simon

Reputation: 63

How to set FA icon as a button, React

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.

Upvotes: 0

Views: 1910

Answers (1)

charchit
charchit

Reputation: 1512

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} />

Upvotes: 1

Related Questions