Variables fetched from MobX store become Proxy
objects in the console.
How can we log the actual variable?
This happens because console.log is an asynchronous function and the object is only formatted later in time. This means that if you follow the title in the debugging toolbar, you can find the updated value.
At that point it is invaluable to understand how MobX determines what to react to. MobX reacts to any existing observable property that is read during the execution of a tracked function.
Yes, MobX 5+ does require proxies. Version 5 was the big proxy-based rewrite. If you need to use MobX in an environment that doesn't support proxies, you need to stick with MobX 4 (as I do, relatively painlessly).
Version 5 was the big proxy-based rewrite. If you need to use MobX in an environment that doesn't support proxies, you need to stick with MobX 4 (as I do, relatively painlessly). Sorry, something went wrong. Facing the same error can anyone tell me how to resolve this one?
Im using object destructuring.
Mobx docs.
Example:
console.log({ ...StoreName.objectYouWantToLog });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With