You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could there be a way to fix this?
Maybe we could have an extendObservable on mobx-react API which would call extendObservable() from mobx and would also rerender any mounted observer component?
If not, maybe just mention in the docs, that extendObservable doesn't really help when your rendering loop is already running and that manual rerender is needed,
BTW, sorry about the complex sample, I was trying out bunch of other things and forgot to reduce it before posting this issue.
The text was updated successfully, but these errors were encountered:
capaj
changed the title
extendObservable doesn't help when we need to introduce new properties to the model-it doesn't rerender
extendObservable doesn't help when we need to introduce new properties to the model-it doesn't rerender mobx-react components
Apr 15, 2016
I just ran into a similar issue where I was trying to use an object as a map. I'm not sure if this is relevant in your case, but the observable map worked really well for me.
@jbrantly is right, you cannot observe not yet existing properties and be notified about them, except when using maps.
Note also that if you would have triggered the TimerView by any some other means to re-render after the timeout. Future changes to num will be picked up as the observer list is re-established after each render.
I would kind of expect that if I run this small app:
that after 100ms it gives me:
But it doesn't. It just gives me
Could there be a way to fix this?
Maybe we could have an
extendObservable
on mobx-react API which would call extendObservable() from mobx and would also rerender any mounted observer component?If not, maybe just mention in the docs, that extendObservable doesn't really help when your rendering loop is already running and that manual rerender is needed,
BTW, sorry about the complex sample, I was trying out bunch of other things and forgot to reduce it before posting this issue.
The text was updated successfully, but these errors were encountered: