in reactjs, how to access the component method from other class by using ES6 method?
<p>in reactjs, how to access the component method from other class by using ES6 method?</p>

<p>I am facing a problem in  React JS. I'm unable to fetch the component method from other class by using enum. </p>

<p>Please help me out to solve this issue. 
I'm trying in ECMA6 format.
Thanks in advance.</p>

<pre><code>import React from 'react';
import {Component} from 'react';

const Message = (props) =&gt;
{
    const Enum = require('node-enumjs');

    var Days = ({
        constants: {
            Monday: {
                say1() {
                    return 'mondays are bad!';
                }
            },
            Tuesday: {
                say: function () {
                    return this.name() + "s are ok...";
                }
            },
            Wednesday: {
                say: function () {
                    return this.name() + " is the middle of the week...";
                }
            }
        }
    })
}

export default Message;

from Message component i have access to say() inside monday.

import React from 'react';
import {Component} from 'react';
import Message from '../../../message';

export default class Content extends Component {
    sai() {
        return(
        &lt;div&gt;
            &lt;h1&gt;{Message.Monday.say1()}&lt;/h1&gt;
            &lt;h1&gt;{Message.Monday.say2()}&lt;/h1&gt;
        &lt;/div&gt;
    )}
    render() {
        return (
            &lt;div className="page-title"&gt;
                &lt;center&gt; Content &lt;/center&gt;
                &lt;button name="press" onClick = {this.sai}&gt;press&lt;/button&gt;
            &lt;/div&gt;

        );
    }
}
</code></pre>

<p>no error, but, when event rise in browser error like this: flows_content.js:14 Uncaught TypeError: Cannot read property 'say1' of undefined</p>