conditional rendering class react code example
Example 1: react conditional class
<div className={"btn-group pull-right " + (this.props.showBulkActions ? 'show' : 'hidden')}>
Example 2: conditional props react
// single prop
propName={ condition ? something : somethingElse }
propName={ condition && something }
// multiple props
{ ...( condition ? { ...setOfProps } : { ...setOfOtherProps })}
{ ...( condition && { ...setOfProps })}