React - Create a Stateful Component

The state of StatefulComponent should be initialized with a property firstName set to a string.
The property firstName in the state of StatefulComponent should render in the h1 element.
I keep getting this errors don’t know whats going on :frowning:

  **Your code so far**
class StatefulComponent extends React.Component {
constructor(props) {
  super(props);

this.state = {
    firstname : "Hello!"
  }

}
render() {
  return (
    <div>
      <h1>{this.state.firstname}</h1>
    </div>
  );
}
}
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0

Challenge: React - Create a Stateful Component

Link to the challenge:

Remember that JavaScript is case-sensitive.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.