Tuesday 21 August 2018

javascript - What does React.component in React apart from creating instance of our component and setting props object on it?

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?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...