FAQ: Components and Advanced JSX - Use a Conditional in a Render Function

Ahh, I forgot to declare it as a variable, it works now! Thanks for your help!!!

class TonightsPlan extends React.Component{
  render(){
    let probs = fiftyFifty ? 'to bed' : 'out';
    return <h1>Tonight I'm going {probs} WOO</h1>
  }
}
1 Like

I can’t start this chapter.

it says “Connecting with Codecademy” on the top right corner and its not loading the Editor. I think its a server side issue. I have disconnected and reconnected my internet connection. I’ve changed my browser. I’ve even connected to my mobile data. Nothing helped.