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 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 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...
I've been trying to make MobX work with my React project. I've followed the babelrc config and also installed transform-decorators-legacy but it seems like I'm getting Parsing error: Unexpected character @ after trying to run my project....
I have one observable array in my store that is deeply nested. Lets called the property people (which contains elements of class Person). Now the Person class has a property products which is an array of Product, a class which also has nesting throug...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.