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

1624 questions
0
votes
1 answer

Using mobx for non-ui state management

I'm experimenting with mobx state management, and I am wondering how this can be used for vanilla javascript code that is not inherently reactive, and has nothing to do with UI. For example: In an app several queries may be executed as soon as the…
richbai90
  • 4,175
  • 3
  • 35
  • 73
0
votes
1 answer

MobX async reactions causing Promise warning

Simplified version of my store... export class DataStore { api; @observable prop1; @observable prop2; @observable data1; @observable data2; constructor(api) { this.api = api reaction( () =>…
0
votes
1 answer

How to initialize form data using async data

experts! I make web service using react. I want to make page to modify user info. I can receive user data and set data to input's value. But, react occur warning it. Warning: A component is changing an uncontrolled input of type text to be…
Jong-Hyen Kim
  • 525
  • 2
  • 4
  • 15
0
votes
0 answers

mobx observer not re-rendering when observable changes

I'm creating a React Native app and I want to add observable/observer pattern but the observer's render function is not re-executing when the observable changes. Here is the store where the observable…
ksairi
  • 11
  • 1
  • 4
0
votes
1 answer

I am trying to update a value in an observable every second in setInterval but mobx is giving me error

I am trying to update the coordinates of a marker on a map in react-native. I am using this data that has some set of coordinates. I want the coordinates to upadate. So that I can see the marker moving. I have applied the setInterval in…
Ankush Kalra
  • 91
  • 1
  • 9
0
votes
2 answers

Checkbox onCheck doesn't fire

I have a checkbox from material-ui that doesn't fire onCheck event. function onCheck() { currentDocument.ispublic = !currentDocument.ispublic; …
Elminday
  • 53
  • 6
0
votes
2 answers

Decorators don't work with custom-react-scripts

I read this article: https://medium.com/@kitze/configure-create-react-app-without-ejecting-d8450e96196a I followed its instruction and here is my code: https://github.com/franva/custom-react-scripts I want to use decorators feature for mobx…
Franva
  • 5,410
  • 16
  • 62
  • 122
0
votes
2 answers

React native component does not react to mobx observable data change

so I started to build a new app with react native and mobx. I have a flat list component that gets his state data from the mobx store list. and when i'm adding new item to the mobx list, it won't re render the flat list view. here is my code: List…
0
votes
1 answer

CSS doesn't apply to a component

I have a react component that is wrapped up in div: AccountLogin.jsx: import './AccountLogin.css'; export default observer(() => (
Something here
)); AccountLogin.css: .content { color: blue; …
0
votes
2 answers

Rebase syncState does not update Firebase data

I'm using Mobx + Reactjs + Firebase + Re-base I have my base.js like: import firebase from 'firebase'; import Rebase from 're-base'; import 'firebase/database'; var app = firebase.initializeApp({ apiKey: "xxxxxx", authDomain: "xxxxxx", …
Franva
  • 5,410
  • 16
  • 62
  • 122
0
votes
3 answers

How to modify value passed by props

I'm a begginer in React and would like to figure out how to modify values get using props. f.e: I have a MobX GameStore.tsx with @observable values: export class GameStore { @observable money = 0; @observable CPS = 0; @observable…
Sincerite
  • 3
  • 2
0
votes
0 answers

Throttle/suspend MobX reactions

I have a search form bound to a handful of fields, each field is part of a MobX store. There is then a search result component, reacting to changes triggering database searches. update searchfields -> mobx store -> observable -> search result ->…
Roger Johansson
  • 20,991
  • 14
  • 87
  • 174
0
votes
1 answer

React: Convert HOC const to component

I am using React Google Maps to add Google Maps to my page, and I am setting up the map here: import React from "react"; import { withScriptjs, withGoogleMap, GoogleMap, Marker } from "react-google-maps"; export const MapWithMarkers =…
user3538055
0
votes
2 answers

Mobx update a single property in an object

I have created an observable property in my store as follows class Store { @observable values = { id: '', name: '' } } This observable object is used in a form, how can I reset these values after the form is submitted?
Ryan
  • 1,594
  • 1
  • 7
  • 15
0
votes
0 answers

Observable doesn't change component in render()

I am using rfx stack with mobx and have created an observable profilePhoto object initializing it to null. OnDrop event (image drop/upload) I change this objects value but in render() function the image doesn't show up. @inject('store') @observer…
1 2 3
99
100