mobx Questions

2

We created a theme.css :root file with a number of commonly used variables to use across the various other .css files for our app. But some of our older code has a similar setup, but in a theme.ts...
Neptunian asked 24/1, 2019 at 22:57

4

Hi I got simple obseverable for testing loading state. abstract class _AccountStore with Store { @observable bool loadingButtonStatus = false; @observable bool get loading => loadingButto...
Balefire asked 15/7, 2019 at 14:33

5

Using Next.js - building this I am porting my app to the next.js framework. Currently, I am re-creating the authentication system, otherwise, this iteration of my app is pretty bare-bones. All of ...
Wodge asked 30/7, 2017 at 18:59

3

Solved

My context looks like this: class AuthStoreClass { authUser = null constructor() { makeAutoObservable(this) } login = async (params) => { const { data: { data: authUser } } = await login...
Trencher asked 10/11, 2020 at 14:24

2

Solved

The recommended way to do asynchronous actions in MobX-state-tree (MST) is to use flow, which takes a generator function as first argument in which every promise should be yielded. yield expression...
Contraceptive asked 19/12, 2020 at 20:18

3

Solved

Variables fetched from MobX store become Proxy objects in the console. How can we log the actual variable?
Conspectus asked 29/8, 2018 at 16:45

4

I'm new to Mobx but so far it's been working great and I've managed to get pretty far. I have a react-native application with mobx, and mobx-persist. I'm using axios to pull posts from a Wordpress ...
Ithaca asked 21/3, 2018 at 4:16

6

Why should I use MobX State Tree over vanilla MobX? It seems like any time I read about MobX, MST is mentioned in the same place. Is anyone actually using just MobX by itself? Probably too general...
Darksome asked 17/3, 2019 at 21:8

2

Solved

I'm new to Mobx and reactjs in general, I have knowledge in Redux and react native, and in Redux when I used to call an action and the props get updated, the componentDidUpdate life cycle method is...
Magritte asked 6/10, 2017 at 7:57

3

Within the mobx-react documentation there are variations in how stores are created. For example, on the React Context page: In the first code sample, the store is instantiated with useLocalStore: ...
Hame asked 6/12, 2019 at 8:20

3

Solved

Assume following structure stores/ RouterStore.js UserStore.js index.js each of ...Store.js files is a mobx store class containing @observable and @action. index.js just exports all stores, s...
Peccary asked 5/7, 2017 at 14:12

4

Solved

I'm using react js with mobx and I get data from api. the data I get is array of objects. when I set the data into mobx variable then I see array of proxy objects(not sure what the proxy says). I'm...
Supertonic asked 30/7, 2018 at 14:59

2

Solved

MobX documentation suggests I should use observer on all my components. However by using inject I get more fine grained control over what data causes a re-rendering of my components. My understand...
Lifer asked 25/1, 2018 at 6:48

2

Solved

I'm having trouble getting MobX to render when updating array. Here is a simplified version of the code: import React, { useState } from 'react' import { flow, makeObservable, observable } from 'mo...
Foredoom asked 7/1, 2021 at 16:11

3

Solved

I've looked at this issue on Github and this question on stackoverflow but am still unsure how to trigger an autorun for the data structure I have. I get the data from storage as a json object. //...
Tonsillitis asked 27/11, 2016 at 16:18

3

Solved

I'm trying to create a model with a optional, nullable string value. I've tried using both hint: types.optional(types.string, ""), and hint: types.maybe(types.string), Both results in erro...
Road asked 14/8, 2018 at 11:45

2

Solved

Mobx supports both @observable and @observable.ref modifiers and their official doc says observable: This is the default modifier, used by any observable. It clones and converts any (not yet obse...
Platinize asked 14/11, 2019 at 6:39

3

Solved

Is it possible to detect when an observable changes in any way? For instance, say you have this: @observable myObject = [{id: 1, name: 'apples'}, {id: 2, name: 'banana' }] And later on, with so...
Ammon asked 11/10, 2016 at 22:30

8

Solved

Upon page load, I see "hi2" When I click the button, nothing happens. I tried with setUser as well. I suspect I'm just editing the props themselves and somehow the observable is not being triggere...
Montemontefiascone asked 1/10, 2017 at 13:49

4

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 ...
Reside asked 8/7, 2019 at 23:18

3

I'm building two widgets with mobx/react, where all the logic sits inside the stores. Both share most of the design rules, so their stores are 95% identical. Is there a smart way to handle this sit...
Kerk asked 8/2, 2018 at 21:36

3

I'm trying to figure out how to structure my app, for example, I have a model User, a generic UserStore to keep track all users load so far and some UI related stores like FriendList, PendingFriend...
Kabyle asked 29/4, 2016 at 5:34

4

Using Mobx, after updating the store (i.e. clicking the button) the component does not re-render. I've installed mobx devtools which shows nothing after the initial load, and there is no error in t...
Justinajustine asked 20/11, 2016 at 9:17

7

this is the first time I face this warning message. Can't call setState on a component that is not yet mounted. Follows: This is a no-op, but it might indicate a bug in your application. In...
Unscratched asked 3/5, 2018 at 19:25

3

Solved

I've built a basic counter React app with a simple MobX store. I was able to create an observable MobX status using makeObservable but for some reason when I try to use makeAutoObservable I get the...
Lunt asked 12/7, 2021 at 18:56

© 2022 - 2025 — McMap. All rights reserved.