Last active
June 17, 2020 10:51
-
-
Save sackeyjason/b207a2a33defa5aed6394f38f0269e9a to your computer and use it in GitHub Desktop.
Conditional props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Component | |
aria-selected={highlight ? true : undefined} | |
/> | |
<Component | |
{...(highlight ? { "aria-selected": true } : {})} | |
/> | |
/* These are not the same ;_; */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment