I use mobx library. It fit well with ReactJS. I have and observable array like this: @observable items = []; When I add an object in this way, I have no problem and the given object will be observable as expected. let x = { Title: "sample tit...
I have a React app (16.8.6) written in TypeScript that uses React Router (5.0.1) and MobX (5.9.4). The navigation works fine and data loads when it should, however, when I click the browser's Back button the URL changes but no state is updated an...
Let's stay I have this myObject loaded via an API call: myObject = { fieldA: { details: 'OK', message: 'HELLO' }, fieldB: { details: 'NOT_OK', message: 'ERROR' }, } Only details and message of each field can...
I'm new to mobx. I was wondering why I'm getting ObservableObjectAdministration when I call the computed getServerUrls() function instead of the object. Below is my store. import { observable, computed } from 'mobx'; import { Serv...
I cant figure out mobx-react... How do I pass props from a mobx observable to a mobx-react observer? The code below doesn't works, but I feel like it should. Can someone tell me what is going wrong? let mobxData = observable({information: "...
I want to make some fake my ajax calls so when on localhost I can bring back dummy data from a fake method instead of doing real calls to my server(where the structure might not exist). What is the best way to do this in reactjs + mobx? I was think...
I'm trying to work with MobX for a new project. I started it on May 2017, and everything was working well. I had to stop, and now I go on developing it. I had to make an npm install to manage making it working, but now, I have some problem with s...
I defined a mobx map as below: @observable editors = observable.map(); then I added object on the editors as below: editors.set(key, { alias: 'alias-1', message: 'hello', }) when I get the object from editor as below...
I have created a store using mobx as follows: import {extendObservable} from 'mobx'; class InfluencerFeedStore { constructor() { extendObservable(this, { data: [] }); } setData(items = []) {...
How I call method of view from async action of store in MobX? For example, I have code, like this: @action someAction() { longOperation() .then(() => { }) .catch(error => { }); } When the function is successful or failed, some meth...
©2020 All rights reserved.