Hide warnings
I have:
- [x] Feature request
- [x] I've checked documentation and searched for existing issues
Lets add in to configuration some prop for hide warnings such this
[mobx-state-tree] Warning: Attaching onAction listeners to non root nodes is dangerous: No events will be emitted for actions initiated higher up in the tree.
like did styled-components https://github.com/styled-components/styled-components/commit/86fac6af698b62965c2649a30d81e46d92c7373e With hmr i have a lot of warnings
Could you share an example of the logs you get when using HMR?
The example in the description of propose, have only onAction warnings
but like, do you get one warning after each hot reload? 100? is it always for the same node? for different ones?
My point is that maybe there could be a cache of warnings that keep track of what warning for what node has been issued to not do it twice
Sure, I made two onAction listeners when store is attached, and after each hmr see in the console again this two warnings. Same nodes.
Maybe cache is better
Why is a warning needed in this case in the first place? It seems obvious to me that an onAction listener will only emit for the subtree it's attached to.
I agree with @rbuels, this warning doesn't really makes sense, since I am aware that it will be applied to to subtree where I am using it. Why is it dangerous in this case?
any solution for this ? is there a alternate way to listen to subtree ?
This is also something we would like to disable when it is purposely implemented