-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Props are not reactive! #158
Comments
Would you please provide a minimal example? I encountered this when I was setting nested properties. (on Monx at least) |
@AndresSepar A reproduction would definitely be helpful. Also, in v0.11, setting nested properties updates the object, but keeps the reference. When Moon diffs the elements, it tests for reference to see if props are the same. In v1, you can use an object or |
Here you can see the test. https://jsfiddle.net/andressepar/tp5x5tpx/6/ |
Just as I suspected. The reference to In this case, they are, and Moon skips updating the component. Moon components are all treated as pure, which is why there is a check in the first place (pure components have an output that depends only on the props passed to it). For now, an easy fix would be doing: var items = instance.get('items').slice(0); Edit: Another thing. @AndresSepar In your example you use That's the purpose of the |
When I update some data by the set method in the root application ... the components are not updating the props data. I think it should work as one-way binding
The text was updated successfully, but these errors were encountered: