DEV Community

Discussion on: Five common mistakes writing react components (with hooks) in 2020

Collapse
 
andrewslobodianiuk profile image
Andrew Slobodianiuk

Thank you for the great article! Could you please clarify, is it valid to wrap 'button' into HTML tag 'a' ? As I know HTML validator will show an error. Maybe if we want to add a link element that looks like a button we should customize 'a' tag?

Collapse
 
pabloabc profile image
Pablo Berganza

Ideally yes. You'd have to style the anchor tag to look like a button. It's considered bad practice to have an interactive element inside of another (a.k.a button inside an anchor, anchor inside another anchor, etc).