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
The setup is simple. React with MobX and TypeScript along with MobX DevTools. The app is pretty much a copy paste of the 10 min todo introduction of MobX. The app works, but once I try to inspect the content of my store with DevTools I receive an error:
I solved the issue, my problem was using utility functions of an observable array ( toJS, slice() ...) in a computed property
classStore{
@observableusers;// init the observable in the constructorconstructor(){this.users=observable.array([]);}// some actions here that mutate your observable ...// generate a console error
@computedgetusers(){returnthis.users.slice();// or toJS()}// works
@computedgetusers(){returnthis.users;}}
The setup is simple. React with MobX and TypeScript along with MobX DevTools. The app is pretty much a copy paste of the 10 min todo introduction of MobX. The app works, but once I try to inspect the content of my store with DevTools I receive an error:
The code for the store is as follows:
The text was updated successfully, but these errors were encountered: