Created
December 11, 2018 06:52
-
-
Save productioncoder/998fe674333afa3ceafd3d82a26f5e54 to your computer and use it in GitHub Desktop.
Youtube in React: applying different SCSS classes depending on the component's local state
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
/* ... */ | |
render() { | |
let descriptionTextClass = 'collapsed'; | |
let buttonTitle = 'Show More'; | |
if (!this.state.collapsed) { | |
descriptionTextClass = 'expanded'; | |
buttonTitle = 'Show Less'; | |
} | |
/* ... */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment