I'm really stuck with the problem. I have a nested menu. After click on the first menu level second level items shows up. After click on one of the children nothing happens. Looks like the observer don't work for deep levels items. I don't know if the "late" type could be a problem. Everything is described in the code: https://codesandbox.io/s/mobx-state-tree-recursive-deep-menu-p7eqj
Thanks in advance
The problem is that when you are using your recursive
TreeItem
component it is not actuallyobserver
. You wrapping it inobserver
only when exporting, butTreeItem
insideTreeItem
is regular component, notobserver
so it doesn't react to anything.Basically you just need to move
observer
decorator:Codesandbox