--- title: Create a Stateful Component --- # Create a Stateful Component --- ## Hints ### Hint 1 ```JSX class StatefulComponent extends React.Component { constructor(props) { super(props); // initialize state here // "This" area may be a good place to use "dot" notation. // dont forget to describe "name" property inside the state and assign your name to a property of "name". } render() { return (

{this.state.name}

); } }; ``` --- ## Solutions
Solution 1 (Click to Show/Hide) ```JSX class StatefulComponent extends React.Component { constructor(props) { super(props); // initialize state here this.state = { name : "Name" } } render() { return (

{this.state.name}

); } }; ```