Create a stateful component

class StatefulComponent extends React.Component {
  constructor(props) {
    super(props);
    // Only change code below this line

    // Only change code above this line
  }
  render() {
    return (
      <div>
        <h1>{this.state.firstName}</h1>
      </div>
    );
  }
};

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

The state goes inside the constructor on this

this.state = {
  someProp: 'somevalue'
}

It is just a class and pretty much works as any class would.

class someClass {
  constructor() {
    this.instanceProperty = {
      prop: "value"
    };
  }
  renderMethod() {
    return `<div>${this.instanceProperty.prop}</div>`
  }
}

const instance = new someClass();
console.log(instance.instanceProperty.prop); // value
console.log(instance.renderMethod()); // <div>value</div>