Access static variable from another class in React-Native app?
<p>in my react-native app I currently have a User class in which I define a current user as below: </p>

<pre><code>class User {
    static currentUser = null;

    //other relevant code here

    static getCurrentUser() {
        return currentUser;
    }
}

export default User;
</code></pre>

<p>In a different class, I am trying to access the set value of this currentUser. I cannot figure out how to correctly call this function; I am getting the error <code>User.getCurrentUser is not a function</code>. Should I be calling this function in a different way?</p>

<pre><code>var User = require('./User');

getInitialState: function() {

    var user = User.getCurrentUser();

    return {
        user: user
    };


},
</code></pre>