import { makeObservable, observable, action } from 'mobx'; import { observer } from 'mobx-react'; import React from 'react'; @observer class Index extends React.Component { @observable x: number = 0; constructor(props) { super(props); } @action clickMe() { this.x += 1; } render() { return ( ); } } export default Index;