Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created December 11, 2018 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/998fe674333afa3ceafd3d82a26f5e54 to your computer and use it in GitHub Desktop.
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
/* ... */
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