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
i triggered an action in componentDidMount, but componentWillReceiveProps can not receive any update.
i look into the code and found out the problem is the wrapper outside my component register a listener while componentDidMount, but its child componet, my component, mounted before the wrapper.
so when my component run componentDidMount, the wrapper haven't run the subscription method yet. therefore it can't reveive any update.
so why not use the componentWillMount to replace the componentDidMount. componentWillMount will be triggered in a right order from parent to child. so subscription function can capture and update any changes from the child component.
The text was updated successfully, but these errors were encountered:
It seems like a bug, due to the reversed execution order for componentDidMount(), which causes the child component's method to fire before the parent (wrapper)'s. The issue stems from here:
this example shows what i had done.
i triggered an action in componentDidMount, but componentWillReceiveProps can not receive any update.
i look into the code and found out the problem is the wrapper outside my component register a listener while componentDidMount, but its child componet, my component, mounted before the wrapper.
so when my component run componentDidMount, the wrapper haven't run the subscription method yet. therefore it can't reveive any update.
so why not use the componentWillMount to replace the componentDidMount. componentWillMount will be triggered in a right order from parent to child. so subscription function can capture and update any changes from the child component.
The text was updated successfully, but these errors were encountered: