We create components in react by extending React.component.I was reading code that in constructor of component we call super(props) and in parent constructor it sets props on our component instance.Apart from instantiating our component instance what else functionality React.component provides when we extends it.I also read if we do not extend react.component we cannot have state of our component.how is it related with state of component?
this
refers to the component instance.this
behaves exactly the same in a react component as it does anywhere else in javascript.also it is function ..we are extending function
Yes, all classes in javascript are functions. The class keyword is just syntactic sugar on top of functions and prototypes. – Nicholas Tower