Skip to content

Instantly share code, notes, and snippets.

@jm2242
Created February 20, 2018 20:24
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 jm2242/cff68ad9c36fd8d22b2cdcb8730e44c8 to your computer and use it in GitHub Desktop.
Save jm2242/cff68ad9c36fd8d22b2cdcb8730e44c8 to your computer and use it in GitHub Desktop.
Cleaner partial solution
render() { // render method of component
// ...
<div className={`column-icons-${numberOfButtons}`}
{ canHideColumns && renderHideColumnsTrigger() }
{ canSort && renderSortingIndicator() }
{ canSearch && renderSearchTrigger() }
{ canRemoveColumns && <RemoveColumnButton /> }
{ canAddColumns && <AddColumnButton }
</div>
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment