title: What is the role of the render() function inside react component?
body: <p>I am newbie in reactjs and confuses on  use of render function inside component class and using with ReactDOM global object.  </p>
  
  <p>Answers to this <a href="https://stackoverflow.com/questions/33465674/render-function-in-reactjs">question</a> don't fully addressed the use of <code>render()</code> function inside the class component. Here in reactjs official site, I found functional component which doesn't make use of render method. So my point is what the role <code>render()</code> function played when creating component [as shown in the below example].</p>
  
  <p>I am following  <a href="https://reactjs.org/tutorial/tutorial.html" rel="nofollow noreferrer">this</a> tutorial. I think using render with ReactDOM creates virtual Dom but what the use of it inside all the component class. On the official tutorial from react <code>render()</code> is used on all component class.</p>
  
  <pre><code>class Square extends React.Component  {
      render() {
          return(
              &lt;button className="Square"&gt;
                  {this.props.value}
              &lt;/button&gt;
          );
      }
  }
  
  ReactDOM.render(
    &lt;Game /&gt;,
    document.getElementById('root')
  );
  </code></pre>