Questions tagged [mobx-react]

MobX is a battle-tested library that makes state management simple and scalable

React and MobX together are a powerful combination. React renders the application state by providing mechanisms to translate it into a tree of renderable components. MobX provides the mechanism to store and update the application state that React then uses.

Both React and MobX provide optimal and unique solutions to common problems in application development. React provides mechanisms to optimally render UI by using a virtual DOM that reduces the number of costly DOM mutations. MobX provides mechanisms to optimally synchronize application state with your React components by using a reactive virtual dependency state graph that is only updated when strictly needed and is never stale.

746 questions
-1
votes
2 answers

React + Mobx How to change value from different components and show changes everywhere?

https://codesandbox.io/s/react-mobx-change-value-in-several-components-f2tuu How to change a variable from different places? The variable is one, but it changes separately in different components and these changes made in one component are not…
ArtSur
  • 9
  • 4
-1
votes
1 answer

How to downgrade Mobx 5 to 4?

Im use mobx in react project, and my project cannot run on explorer (ie11). I get an error that only mobx 4 can work with ie11. Is it possible to downgrade mobx from 5 to 4 in my project? If it possible how can I do it? Thanks!
-1
votes
1 answer

"mobx-react" package is deprecated?

mobx-react Now not recommended to use? https://github.com/mobxjs/mobx-react
it-efrem
  • 79
  • 5
-1
votes
1 answer

React & MobX - To use React's state with MobX is anti-pattern?

In most cases, I use observable with observer() in React components instead of React's state. However, to use React's state with MobX is anti-pattern? For example, is this below anti-pattern? @observer class Counter extends React.Component { state…
Yonggoo Noh
  • 1,486
  • 3
  • 16
  • 34
-1
votes
1 answer

Problems re-rendering Flatlist

I am struggling with the update of a list when deleting a given user(s). Most of the problem comes from the fact that I lose the state because I place the function in the componentDidMount as a setParams. componentDidMount() { ... …
user123
  • 165
  • 3
  • 15
-1
votes
1 answer

Lifecycle for controlled textinputs

I was wondering if the mobx cycle is triggered on observable change only in stores outside of react components in HOClass operation because there is a top level Provider to mobx stores which is triggering a react component re-render. …
mibbit
  • 3,731
  • 3
  • 18
  • 32
-1
votes
1 answer

electron not allowed to load local resource

I am looking to use React application using MobX framework, into Electron. I have success loading MobX with React, but when I try to wrap it with Electron, I have a console error message not allowed to load local resource My package JSON : { …
thormayer
  • 1,020
  • 5
  • 27
  • 47
-1
votes
1 answer

Array push not working as expected in react app

In my React app I am using MobX for state management.After processing ajax response I tried to push to store. But turns out it just not working as expected. Here the codes: export class Diary { @observable loaded = false; @observable posts =…
pyprism
  • 2,644
  • 9
  • 39
  • 73
-2
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
  • 448
  • 6
  • 19
-2
votes
1 answer

Array length undefined in mobx store

I am trying to shift from Redux to Mobx and tried setting up an array in the mobx store, i use decorators to set the value. I am able to return static value from the store but the array length below always throws and undefined value. Not sure what…
Sudheej
  • 1,615
  • 6
  • 21
  • 46
1 2 3
49
50