Skip to main content

Posts

Showing posts with the label render() method

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 , publ...