You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a component has no way of knowing when it acquires new children or loses existing ones. Which is a shame really, because how it can take good care of its children if it doesn't know what happens to them?
Proposal
Add a new lifecycle method .onChildrenChanged() which would fire whenever new children are added to the component, or existing children removed.
The method could have an argument child, which would indicate the component that caused the lifecycle event. If child.parent == this then the child was just added to the current component; otherwise it was removed.
Problem to solve
Currently a component has no way of knowing when it acquires new children or loses existing ones. Which is a shame really, because how it can take good care of its children if it doesn't know what happens to them?
Proposal
Add a new lifecycle method
.onChildrenChanged()
which would fire whenever new children are added to the component, or existing children removed.The method could have an argument
child
, which would indicate the component that caused the lifecycle event. Ifchild.parent == this
then the child was just added to the current component; otherwise it was removed.More information
This would be useful for #1944
The text was updated successfully, but these errors were encountered: