Render with an If/Else Condition

Tell us what’s happening:

What am I missing here?

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 (
      <button onClick={this.toggleDisplay}>Toggle Display</button>
    }else {
      <button onClick={this.toggleDisplay}>Toggle Display</button>  

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15.

Link to the challenge:

In your else-block, you’re missing the return keyword.

Oops! Thanks :slight_smile: