Render State in the User Interface Another Way

Tell us what’s happening:

Your code so far

class MyComponent extends React.Component {
  constructor(props) {
    this.state = {
      name: 'freeCodeCamp'
    const name =;
  render() {
    // change code below this line

    // change code above this line
    return (
        { /* change code below this line */ }
        <h1>{ name }</h1>
        { /* change code above this line */ }

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:

Please tell us exactly what you need help with. Be as detailed as you can.

1 Like

Hi, I’m not sure what I’m missing in this challenge. <MyComponent /> should render the name in H1 element, but it doesn’t.

Any Idea?

You need to think about where you should be initializing your const name.

Oops! Thanks. It’s worked.