Questions tagged [mobx]

Functional reactive programming library in JavaScript.

About

MobX is a battle tested library that makes state management simple and scalable by transparently applying functional reactive programming. The philosophy behind MobX is very simple:

Anything that can be derived from the application state, should be derived. Automatically.

which includes the UI, data serialization, server communication, etc.

Links

1876 questions
0
votes
1 answer

Mobx's observable loses child objects equality

When I create an observable from plain object which contains fields that are effectively same objects, this property are not equal objects anymore. So if I change one's property, the second stay untouched. Is there a proper way to handle…
huston007
  • 1,972
  • 1
  • 16
  • 13
0
votes
1 answer

A widget is not rebuild after a change in the Mobx.dart store

I would like to get some help. I don't understand why something is not rebuilding properly. I have an app.dart which provides all stores and the body of the Scafold is a home page, class HomePage extends StatelessWidget { const HomePage({Key key})…
ZlatiP
  • 185
  • 6
0
votes
2 answers

mobx reaction on filtered list

I want to listen to the change on specific items of list. I used reaction on my list and I filtered my list to get the specific items which I need to listen, but reaction fires when new new item adds to list (out of my filtered list) This is my…
SiSa
  • 2,594
  • 1
  • 15
  • 33
0
votes
1 answer

Error while displaying a @computed value using mobx and nextjs

I have an error in my app using mobx and nextJS. The error as shown at the dev tools is: index.js:1 Warning: Did not expect server HTML to contain the text node "3" in

. in h1 (at pages/index.tsx:18) in div (at pages/index.tsx:17) in…

0
votes
1 answer

Mobx react test component

It's driving me crazy. How test react with mobx with useContext ? I'm trying to do with jest and enzyme, but when I try export const HelloWorldView = observer(() => { const { store } = useHelloWorldController() const dataStore =…
Xero
  • 3,951
  • 4
  • 41
  • 73
0
votes
1 answer

Unable to use React context

I am unable to use React context when I import context from a different file. i.e when i try to print store.bugs in BugsList.js file. I get TypeError: Cannot read property 'bugs' of undefined. However when I put them together (as shown in this…
SpaceX
  • 2,814
  • 2
  • 42
  • 68
0
votes
1 answer

mobx: class method call when changing data

Сan I use the Mobx library to call a class method when data changes? For example MyObject writes container['item'] = 10 and as a result the myaction method is called. class MyElement extends Component { // modifiable data container:…
Zhihar
  • 1,306
  • 1
  • 22
  • 45
0
votes
0 answers

Loader not running while making request to db

I'm sorry because this is going to be a long post, but I would really appreciate help. I have been trying to make it work, but with no luck. I am making a call to the database to grab images, during this call I want the loader to be active. The…
Amelia W
  • 105
  • 1
  • 9
0
votes
1 answer

Removing tag element from array also removes the tag behind it react antd

I'm having an issue when I delete a tag that has another tag behind it. For example if i have two ant Tags and i delete the first one, the second one disappears, but when i console.log it, the second one technically is still there. But if I have two…
ianman18
  • 43
  • 4
0
votes
1 answer

Unit test case when Mobx + RootStore + useContext hook

When mobx store is used from useContext() hook what will be best approach to write unit test case? Should we use enzyme or react testing library? Here Provider or @inject() is not used Store design: //StoreA export class StoreA { rootStore:…
ksh
  • 639
  • 1
  • 7
  • 23
0
votes
1 answer

React Incorrect render when combine withRouter/withStyles and mobx's observer

I'm building an react app with mobx. Everything was working fine with withRouter and withStyles, since I need to access the store, so I added store to the component as a wrapper in observer. But since I've done that, the rendering stopped working…
DatCra
  • 253
  • 4
  • 13
0
votes
2 answers

Mobx Generic Observer using Typescript typing

I would like to wrap the following function in mobx's observer(), but can't seem to figure out how to do that (or if it's possible) while maintaining the generic typing: interface GenericProps { arg: T; } const foo: (props: GenericProps)…
Jonas
  • 1,473
  • 2
  • 13
  • 28
0
votes
0 answers

When links are open in new tab from react application different information is shown on all tabs

I am stuck in a situation. I am creating a table component in which admin can see all the registered users like I am using Mobx as store Username email phone abc abc@abc.com 000 bcd bcd@bcd.com 000 def…
Geetanshu Gulati
  • 692
  • 8
  • 13
0
votes
1 answer

MaterialTable Dynamic Lookup

I am using: import MaterialTable from "material-table" I am trying to make the 'lookup' for an editable table dynamic. When I edit the table I want there to be a drop-down with my edit options, not the default blank space. Here are my columns: let…
Amelia W
  • 105
  • 1
  • 9
0
votes
1 answer

Flutter - Retrieve MobX @action return value in screen load without click

I have MobX @action which successfully return a value. Wondering how to retrieve the value in initial screen load without click or tap anything. abstract class _ProfileMobx with Store { @observable User user; @observable String name =…
Wannabe
  • 13
  • 4