Class-based components are those kinds of components that are made using the concepts of classes. These components extend the React Component.
Class components don’t have state variable-specific setters; they are set using a generic function which is this.setState. All the state variables are initialized inside the constructor.
this.state will be used to access the state and this.props will be used to access the props.