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

Do not clear componentParent on destroy #61

Open
mitar opened this issue Jun 21, 2015 · 1 comment
Open

Do not clear componentParent on destroy #61

mitar opened this issue Jun 21, 2015 · 1 comment

Comments

@mitar
Copy link
Member

mitar commented Jun 21, 2015

I am thinking that it is useful to not clear componentParent on destroy of a component. How it currently works is that when a component is created, componentParent and (corresponding children entry) is created. And when the component is destroyed, this it is cleared.

But this does not work well with a pattern where you are reusing components. In some cases it is better to create components in advance and then render them when needed. So same component is rendered multiple times. And components have a persistent hierarchy, and some of them gets rendered and some removed. But components are there all the time. And sometimes you then want to walk up and down the hierarchy even if the component is not rendered to still update its internal state. So that when it gets rendered again, the state is set.

So this would be slightly backwards incompatible. To get current behavior you should filter results from componentParent and componentChildren using isCreated. But I am not sure if people really depend on this behavior?

cc @Retronator

@mitar mitar changed the title Not clearing componentParent on destroy Do not clear componentParent on destroy Oct 17, 2015
@mitar
Copy link
Member Author

mitar commented Dec 29, 2015

Then we can maybe check the structure after rendering on the server side in the testBlockHelpersStructure test?

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

1 participant