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 destroy new components with equivalent props if rerendered before being mounted #1577

Open
ged-odoo opened this issue Jan 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ged-odoo
Copy link
Contributor

ged-odoo commented Jan 9, 2024

While a template is being rendered, if Owl finds a new child component, it will create it.

<div>
    <C />
</div>

Now, if later (but before animation frame) the parent component is re-rendered, Owl will create a new RootFiber. To do this, it will check for the current rendering, and cancel all the current fibers. This will in turn destroy the new instance of C, because C has not been mounted yet.

This makes sense usually, because the sub component has been willStarted, and we don't want to execute onWillStart twice. However, in our case, C has no props. So, it would make sense to keep the same instance in this case (same applies for components with equivalent props).

@sdegueldre sdegueldre added the enhancement New feature or request label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants