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
Basically, it seems that when a component will be unmounted, it's componentWillUnmount method needs to be called after those of the elements that it owns.
This issue is related to #2789 and should probably be addressed (although the part about mixins can be ignored).
The text was updated successfully, but these errors were encountered:
By console.logging inside of componentWillUnmount methods of all my components, I can indeed see that the calls happen in pre-order, but IMHO they should happen in post-order.
I haven't verified, but as reasoned in #2789, it makes sense to do the mounting in reverse of the unmounting (pre-order).
This is intentional. componentDidMount of a parent gets called after componentDidMount of its children, so you know your children are fully initialized before using them. Likewise, componentWillUnmount is called before children (the reverse of componentDidMount) so that you have a chance to reverse anything that you might have done in componentDidMount.
For react-famous, probably an alternate rendering backend is more appropriate, more like react-art or react-canvas or react-native but we don't yet have a good supported way to do that. (Unlike the lifecycle method, that would allow you to do the actual unmounting in the order you prefer.) Your solution of removing the children from the parent sounds pretty reasonable though.
For details, see here: pilwon/react-famous#21
Basically, it seems that when a component will be unmounted, it's
componentWillUnmount
method needs to be called after those of the elements that it owns.This issue is related to #2789 and should probably be addressed (although the part about mixins can be ignored).
The text was updated successfully, but these errors were encountered: