React + Mobx: 'this' is null when trying to update store
问题 Just getting started with Mobx & React and having trouble getting the store to update. I get error when clicking the button, which should update the 'me' property: Store.js:12 Uncaught TypeError: Cannot set property 'me' of null My store: import { observable } from 'mobx'; class Store { @observable me; constructor() { this.me = 'test'; } change_me(){ this.me = 'test 1'; console.log(this); // null??? } } const store = new Store(); export default store; The component: import React from "react";