Created
July 23, 2020 12:22
-
-
Save treyhuffine/00280335b5687ab399f9e68912e42c62 to your computer and use it in GitHub Desktop.
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
import './styles.css'; | |
const ClassStylesComponent = () => { | |
const [isActive, setIsActive] = useState(false); | |
const className = isActive ? 'button--active' : 'button'; | |
return ( | |
<div> | |
<button onClick={() => setIsActive(!isActive)} className={className}> | |
click me | |
</button> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment