title: How to call a function which is inside a class in React?
body: <p>How can i call a function which is inside a class ?
  here is the code -</p>
  
  <pre><code>class FriendList extends Component {
      demoFunction()
      {
        console.log('Inside demo function')
      }
      render(){
      &lt;div&gt;Hello&lt;/div&gt;
      }
  }
  
      const button= () =&gt; {
        return (
      &lt;button onClick={() =&gt; demoFunction()}&gt;Button&lt;/button&gt;//How can i call demo function here?
        );
      }
  </code></pre>