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
We are swapping out the tree prop to show different trees when the user clicks on a navigation link. When the user clicks on a node in the tree or clicks on a collapse icon, the next time they click on one of the external navigation links, the tree ignores the new prop.
The problem appears to be in the componentWillReceiveProps method which checks the status of _updated in order to determine whether or not to initialize a new tree. Clicking a node or collapse icon sets _updated to true which prevents initialization of a new tree, even though that is the desired outcome when a different tree is passed in as a prop.
_updated is only ever reset to false when the component is getting new props, so I can't see what purpose this check serves. I can fix my issue by removing this check, but without knowing why the check is there in the first place, I am hesitant to do so.
The text was updated successfully, but these errors were encountered:
We are swapping out the tree prop to show different trees when the user clicks on a navigation link. When the user clicks on a node in the tree or clicks on a collapse icon, the next time they click on one of the external navigation links, the tree ignores the new prop.
The problem appears to be in the componentWillReceiveProps method which checks the status of _updated in order to determine whether or not to initialize a new tree. Clicking a node or collapse icon sets _updated to true which prevents initialization of a new tree, even though that is the desired outcome when a different tree is passed in as a prop.
_updated is only ever reset to false when the component is getting new props, so I can't see what purpose this check serves. I can fix my issue by removing this check, but without knowing why the check is there in the first place, I am hesitant to do so.
The text was updated successfully, but these errors were encountered: