How can I call parent method in a child React component?
<p>I have a parent and child compoents and I want to call a parent method in the child component like this:</p>

<pre><code>import Parent from './parent.js';
class Child extends React.Component {
    constructor(props) {
        super(props);
        };

    click() {
        Parent.someMethod();
    }

    render() {
          &lt;div&gt;Hello Child onClick={this.click}&lt;/&gt;
    }
}

class Parent extends React.Component {
    constructor(props) {
        super(props);
        };

    someMethod() {
        console.log('bar');
    }

    render() {
          &lt;div&gt;Hello Parent&lt;/&gt;
    }
}
</code></pre>

<p>This returns an error message:</p>

<p><code>Uncaught TypeError: _Parent2.default.someMethod is not a function</code></p>

<p>How can this parent method be called in the child component?</p>