Questions tagged [mobx-state-tree]

mobx-state-tree is a state container for javascript apps that is powered by Mobx

209 questions
0
votes
0 answers

Injecting MobX State Tree store into react components throwing error

Issue: I am getting an error when attempting to inject a MST store into react class component: Error: Uncaught [Error: MobX injector: Store 'auth' is not available! Make sure it is provided by some Provider the error stems from the LoginForm…
studiobrain
  • 1,135
  • 2
  • 13
  • 35
0
votes
1 answer

Mobx state tree getting started part 2

Does anyone know if there's a second part of the getting started available? I can see there is an annotation about the second part but actually there is no link nor any further information about it. At least I can't find it. Anyone knows? Next up …
Mugetsu
  • 1,739
  • 2
  • 20
  • 41
0
votes
1 answer

Mobx state tree nested stores injection

I have one issue using mobx-state-tree. If we have nested stores with following structure login(store):{ //some primitives }, mainPage(store):{ slider:(store):{ //some primitives }, userList:(store):{ //some…
0
votes
1 answer

AXIOS Async/Await How to best write the code?

I am writing my first ajax call using Axios, Mobx/Mobx State Tree (MST) and Reactjs. In MST they have something called flows what basically does the same thing as async/await getCustomers: flow(function * (){ const response = yield…
chobo2
  • 83,322
  • 195
  • 530
  • 832
0
votes
1 answer

mobx-state-tree literal array

is it possible to create literal array type in MST? It should be an equivalent to type Interval = ['1min', '5min']; here is an example of code which throw an error type Interval = '1min' | '5min'; export interface AppStore { config: { …
Eduard Jacko
  • 1,974
  • 1
  • 16
  • 29
0
votes
1 answer

Single Object in Mbox State tree?

If I made a store(RegistrationStore) and there is only 1 company created what type do I use? .model("RegistrationStore", { company: types.optional(????) })
chobo2
  • 83,322
  • 195
  • 530
  • 832
0
votes
0 answers

Mobx state with async call

So I'm having mobx store: ... const Auth = types.model({ token: types.optional(types.string, "") }) export const AuthStoreModel = Auth .actions(self => ({ login: flow(function* (email, password){ const response =…
Mil
  • 113
  • 1
  • 11
0
votes
1 answer

Mobx(4.0.1) and mobx-state-tree(1.3.1) not compatible

OS - Windows 10 x64 NodeJs v8.9.3 npm 5.7.1 repository for sample code - https://github.com/niral3737/testMobxStateTreeApp I am working with mobx-state-tree and I have created a model Invoice with a field name. I am using that model in App.js…
Niral Patel
  • 62
  • 1
  • 7
0
votes
1 answer

How do you store a non mobx-state-tree type (Class instance) in models?

I get: Error: [mobx-state-tree] expected a mobx-state-tree type as first argument, got class HubConnection { constructor(urlOrConnection, options = {}) { options = options || {}; When trying to do this: import { HubConnection }…
Soren
  • 307
  • 1
  • 2
  • 11
0
votes
1 answer

Is it possible to set a type that doesn't invoke the render() method in React-Native? mobx state tree

I'm in the process of familiarizing myself with React right now. I chose mobx-state-tree for state management. Since I used the MVP pattern in my Android projects, I would apply the same principle to mobx-state-tree. How I currently implemented, it…
sperling
  • 56
  • 7
0
votes
0 answers

Attempting to access a types.reference(Model) before it's id is set for mobx-state-tree?

Got a question. So I'm making a small app working with the github api (using mobx-state-tree and mobx). I'm brand new to both. I'm having a problem: you see selectedRepo? If i set an id to it, I can access selectedRepo. However... if I attempt to…
Rey
  • 3,639
  • 5
  • 33
  • 40
-1
votes
1 answer

Mobx State Tree not re-rendering component

I'm trying to make MST work with a simple model and a single component within my route. The update function is called correctly but the component is not rendered again. import { observer } from 'mobx-react' import PDFMaker from '../store' const…
amankapur91
  • 484
  • 4
  • 15
-1
votes
2 answers

Multiple Async Calls?

I am using async/await. I am wondering how do I do multiple async calls all in parallel? do I do async method(){ call1(); call2(); } as it seems at least from the debugger it is calling one at a time. I am not sure if since I am using mobx…
chobo2
  • 83,322
  • 195
  • 530
  • 832
-1
votes
1 answer

Should I make a new Store or use an existing store? - Mobx State Tree?

I have classic example of Companies and Employees. Right now I have a CompanyStore that has Array of companies and each company can have an array of employees. Now this structure works great when in my admin section and you want to see how many…
chobo2
  • 83,322
  • 195
  • 530
  • 832
1 2 3
13
14