Answer the question
In order to leave comments, you need to log in
Is a component an instance of a class or the class itself in React JS?
When we have
class A extends Component{
...
}
<A />
. We can say that we create an instance of the class A
.
Answer the question
In order to leave comments, you need to log in
JSX is syntactic sugar over the React.createElement call. When you write <A />
, you're making a call:
React creates an instance of this component under the hood.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question