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
I have a weird problem. remotedev won't show any activity in the Chrome extension window if I enable MobX's useStrict. It will correctly show the stores, but only with default values, and will never react to actions or changed observables. The app is working fine, and mobx-react-devtools works fine as well. As soon as I remove useStrict(true) it works perfectly.
// circle-chart.moby.tsimportremotedevfrom'mobx-remotedev/lib/dev';import{action,observable,runInAction}from'mobx';
@remotedevexportclassCircleChartStore{
@observablecircleChartValue=0;
@actionasyncfetchValue(){constpercentage=/* does async stuff here*/runInAction('Update fetched Circle Chart data',()=>{this.circleChartValue=percentage;});}}
Example React app
// index.tsximport*asReactfrom'react';import*asReactDOMfrom'react-dom';import{Grid}from'./grid/';import{Provider}from'mobx-react';importDevToolsfrom'mobx-react-devtools';import{CircleChartStore}from'./circle-chart.moby';import{useStrict}from'mobx';useStrict(true);functioninitStores(): AllStores{constcircleChartStore=newCircleChartStore();/** more stores here **/return{ circleChartStore,/** more stores **/};}constmobxStores=initStores();ReactDOM.render(<Provider{...mobxStores}><div><DevTools/>
/** App here **/
</div></Provider>,document.getElementById('root')asHTMLElement,);
I am running Redux as well, but haven't enabled the DevTools extension for my Redux store.
Another, maybe related problem
I HAVE to import remotedev using import remotedev from 'mobx-remotedev/lib/dev';, it won't work using the normal import, even though I KNOW that process.env.NODE_ENV === 'development' because I use that elsewhere in the app without failure. I don't know if this is related or not, but I thought that it might be nice to know.
The text was updated successfully, but these errors were encountered:
I have a weird problem. remotedev won't show any activity in the Chrome extension window if I enable MobX's
useStrict
. It will correctly show the stores, but only with default values, and will never react to actions or changed observables. The app is working fine, andmobx-react-devtools
works fine as well. As soon as I removeuseStrict(true)
it works perfectly.My setup:
react-scripts-ts @ 2.6.0
(using TypeScript)Example store
Example React app
I am running Redux as well, but haven't enabled the DevTools extension for my Redux store.
Another, maybe related problem
I HAVE to import remotedev using
import remotedev from 'mobx-remotedev/lib/dev';
, it won't work using the normal import, even though I KNOW thatprocess.env.NODE_ENV === 'development'
because I use that elsewhere in the app without failure. I don't know if this is related or not, but I thought that it might be nice to know.The text was updated successfully, but these errors were encountered: