-
In the past destructuring was discouraged, is this still the case?
However, now it doesn't state that, and in Understanding reactivity it says that destructured values are tracked:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Destructuring should work with no issues. I don't understand why it was discouraged before. Maybe because Mobx didn't use ES6 Proxy in the past? |
Beta Was this translation helpful? Give feedback.
-
Destructuring was always fine. It's more about dereferencing late: |
Beta Was this translation helpful? Give feedback.
-
It is true destructuring perfectly works for observables. However I get uncaught exception every time when I try to use destructured actions. I haven't also seen places where destrucutured actions were used in the doc examples. It'd be helpful If someone explain why this is so |
Beta Was this translation helpful? Give feedback.
Destructuring was always fine. It's more about dereferencing late:
https://mobx.js.org/react-optimizations.html#dereference-values-late
https://mobx-react.js.org/ was more or less a personal project of
mobx-react-lite
's original author FredyC.It's just an unfortunate choice of words combined with opinionated usage patterns.