how to declare state in class base component react code example Example: component did mmount componentDidMount()