react-ui-tree icon indicating copy to clipboard operation
react-ui-tree copied to clipboard

clicking node or collapse causes tree to ignore next prop change

Open tadufre opened this issue 7 years ago • 1 comments

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.

tadufre avatar Jun 26 '17 15:06 tadufre

+1

mcmichaelchan avatar Oct 10 '19 07:10 mcmichaelchan