8

Variables fetched from MobX store become Proxy objects in the console.

How can we log the actual variable?

remidej
  • 1,428
  • 1
  • 14
  • 21

3 Answers3

7

Im using object destructuring.

Mobx docs.

Example:

console.log({ ...StoreName.objectYouWantToLog });
Raz
  • 434
  • 7
  • 6
3

Have you tried using .toJS()?

https://mobx.js.org/api.html#tojs

Dave Cole
  • 2,446
  • 2
  • 20
  • 26
0

For nested objects, you can also use JSON.parse(JSON.stringify(storeName))

Naga Kiran
  • 8,585
  • 5
  • 43
  • 53