H
H
humanIvan2018-07-20 21:40:00
React
humanIvan, 2018-07-20 21:40:00

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;

render method is inherited from extends Component??
Why don't we write this.render() ???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Spirin, 2018-07-20
@humanIvan

render method inherits from extends Component??

No, you must define this method yourself.
Because it's a lifecycle method, and like all lifecycle methods, it's called by the library's internal implementation. You can read more about the React.Component lifecycle here .

M
Mykola Ivashchuk, 2018-07-20
@mykolaim

There is a creation (and not a call) of the render method that returns JSX, and JSX is processed somewhere and somehow.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question