Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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} />
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading