-
Of course this has been posted here over and over. I really want to know.. How do I troubleshoot mobx? Where do I put breakpoints to inspect the flow on action -> observers -> observed-values -> component? Intended outcome: I am trying to add an object inside an array inside an object inside an array which is part of the mobx store. I expect the component observing the store to re-render. Actual outcome: The component does not re-render I see that the context store object has updated How to reproduce the issue: It used to work! I do not know how to reproduce the issue. Please see what I ask about troubleshooting above. Versions package.json:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Just to add more information, this is a websocket's .onmessage() adding a record to the array. It's using an action to do so (a member arrow function of the store class) |
Beta Was this translation helpful? Give feedback.
-
Have you consulted https://mobx.js.org/analyzing-reactivity.html ? Also highly suggest configure({
computedRequiresReaction: true,
reactionRequiresObservable: true,
observableRequiresReaction: true,
}) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. I thought about the problem a little bit more. I moved the |
Beta Was this translation helpful? Give feedback.
-
@kovkev This ESLint rule may be helpful for you (to avoid such bugs in the future): https://github.com/mobxjs/mobx/tree/main/packages/eslint-plugin-mobx#mobxmissing-observer |
Beta Was this translation helpful? Give feedback.
Have you consulted https://mobx.js.org/analyzing-reactivity.html ?
Also highly suggest
https://mobx.js.org/configuration.html#linting-options