React Lifecycle Components

React Render Method | Lifecycle Components

The Render Method -
The render () method is used to display the actual outputs HTML to the DOM.
The render () method is required and this method has to return something whether it is null.

Explore to Understand  - React Lifecycle Components

When Render method is called?
When render method is called it returns a new virtual DOM structure of the component.

As an Example,
import React from 'react';

class Header extends React.Component {
  constructor(props) {
    super(props);
    this.state = {msg: "welcome!"};
  }
  render() {
    return (
      <h2>{this.state.msg} you anil</h2>
    );
  }
}

As an another Example,

public class Header extends React.Component {
  render() {
    return (
      <h2>This one is a Header component</h2>
    );
  }
}

ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

www.code-sample.com/. Powered by Blogger.
^