Practice
You must not use curly braces inside quotes, because they will be evaluated as a string.
<div className="btn-panel {this.props.visible ? 'show' : 'hidden'}">
Instead, you need to move the curly braces outside (and don't forget to include the spaces between class names):
< div className = { ' btn-panel ' + ( this . props . visible ? ' show ' : ' hidden ' ) } >
Template strings will also work:
<div className={`btn-panel ${this.props.visible ? 'show' : 'hidden'}`}>
Comments