Use && for a More Concise Conditional

Tell us what’s happening:


Your code so far

class MyComponent extends React.Component {
  constructor(props) {
    this.state = {
      display: true
    this.toggleDisplay = this.toggleDisplay.bind(this);
  toggleDisplay() {
      display: !this.state.display
  render() {
    // change code below this line
    return ({(this.state.display) &&
         <button onClick={this.toggleDisplay}>Toggle Display</button>
      <button onClick={this.toggleDisplay}>Toggle Display</button>  

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:

What is your question? What have you tried?

return (
       <button onClick={this.toggleDisplay}>
             Toggle Display 
       {this.state.display && <h1>Displayed!</h1>}