The Render method is inherited in extends?

import React { Component } from 'react';
import { styles } from '../styles';
import { View Text } from 'react-native';
import { connect } from 'react-redux';

class Progressbar extends Component {
 constructor(props) {
super(props);
 this.state = {

};
}

 render() {

}
}


export default Progressbar;


the render method is inherited from Component extends??

Why don't we write this.render() ???
June 3rd 19 at 19:24
2 answers
June 3rd 19 at 19:26
Solution
the render method is inherited from Component extends??

No, you have to define this method yourself.

Why don't we write this.render() ???

Because it is the method life cycle, and as with all lifecycle methods it is called by the internal implementation of the library. More about the life cycle of React.Component you can read here.
But this is internal implementation libraries, it comes to us from extends Component? - callie2 commented on June 3rd 19 at 19:29
that comes? In the render method React.Component no and if you do not define in the console will take off warning, and error. - Lenny.Botsfo commented on June 3rd 19 at 19:32
That is, I decide, and then just picks up. Library React.Component? - callie2 commented on June 3rd 19 at 19:35
Libraries react and react-dom and they don't pick up and use. - Lenny.Botsfo commented on June 3rd 19 at 19:38
June 3rd 19 at 19:28
Happens creation ( not call ) the render method which returns the JSX, and the JSX somewhere and somehow is being processed.
You probably will be surprise, but render returns a view object:
{
 $$typeof: Symbol(react.element),
 key: null,
 props: { className: "greeting", children: "Hello, world!" },
 ref: null,
 type: "h1",
 _owner: null,
 _store: { validated: false },
 _self: null,
 _source: null,
 __proto__: Object,
}

which is nothing more than a Virtual DOM Node.

But the JSX is just syntactic sugar over the challenges React.createElement. So wherever you're using JSX you need to do import React. - callie2 commented on June 3rd 19 at 19:31
thanks for the info, but the answer to the question has not changed. - Lenny.Botsfo commented on June 3rd 19 at 19:34

Find more questions by tags React