Answer the question
In order to leave comments, you need to log in
What is a class component in React?
More precisely, I understand that such an entry is called class component (class component), but why not component class (component class)? After all, the second option would be more correct, or tell me how to translate into Russian - the component class? Otherwise, how to understand then the class component, what does it mean?
class App extends React.Component {
constructor(props) {
super(props)
this.state = { username: 'johndoe' }
}
render() {
const { username } = this.state
return(
<div>
{ username }
</div>
)
}
}
Answer the question
In order to leave comments, you need to log in
In this case, class is the type of the component. It is more correct to translate not "class component", but "class component", as opposed to functional
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question