How to get the mobx observer value in react component ?
how to get the observer value in the react component> I have a store with simple object observer
import { action, computed, observable } from "mobx";
class TaskStore {
@observable public task = {};
@observable public boards = [];
@action public addNewTaskJson(storageJson: Object[]) {
this.task = storageJson;
}
public get getTask() {
return this.task;
}
}
const store = new TaskStore();
export default store;
AND THE COMPONENT I am having simple like this
@inject("TaskStore")
@observer
export default class TaskContainer extends React.Component<ITaskContainerProps, ITaskContainerState> {
constructor(props: ITaskContainerProps) {
super(props);
}
public componentDidMount() {
console.log("TaskStore.task", this.props.TaskStore.task);
}
....
....
...
And In this log, I am getting like this