Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clicking node or collapse causes tree to ignore next prop change #56

Open
tadufre opened this issue Jun 26, 2017 · 1 comment
Open

clicking node or collapse causes tree to ignore next prop change #56

tadufre opened this issue Jun 26, 2017 · 1 comment

Comments

@tadufre
Copy link

tadufre commented Jun 26, 2017

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.

@mcmichaelchan
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants