Trying to use mobx in react native but heremes

Viewed 16

TypeError: Cannot read property 'fetchLoginResponse' of undefined, js engine: hermes

class LoginStore {
    count=0;
    constructor(){
        makeObservable(this,{
                fetchLoginResponse: action,
                count: observable,
        });

    }
    fetchLoginResponse() {
        this.count = this.count + 1;
    }
 
}

export default loginstore = new LoginStore();

const handleLoginPress = () => {

     loginstore.fetchLoginResponse();

};

0 Answers
Related