Can’t call setState on a component that is not yet mounted

This warning that you are getting is because you are setting a reference to clickMe method in the constructor, which is then using the setState(). constructor (props) { super(props) this.state = { initial: ‘state’, some: ” } this.clickMe = this.clickMe.bind(this); <— This method } clickMe () { this.setState({ some: ‘new state’ <– the setState reference … Read more

mobx-react observer don’t fires when I set observable

Are you using MobX 6? Decorator API changed a little bit from MobX 5, now you need to use makeObservable method inside constructor to achieve same functionality as before: import { observable, action, makeObservable } from “mobx”; export class TestStore { @observable timer = 0; constructor() { makeObservable(this); } @action timerInc = () => { … Read more