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

Fix diffing cloned rsx nodes by deep cloning nodes before mounting them #3271

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented Dec 2, 2024

This PR fixes diffing after hot reloading the rsx inside of the resource in the dog app example. The resource was returning a cloned version of the rsx from the previous run which was mounted. We should never have mounted VNodes in components so that cloning VNodes works as expected. This PR fixes the issue by performing a deep clone of the VNode before diffing so the version of the vnode that lives in diffing/core doesn't share the same Cell<Mount> as the version of the vnode that lives in the component.

@ealmloff ealmloff added bug Something isn't working core relating to the core implementation of the virtualdom labels Dec 2, 2024
@jkelleyrtp jkelleyrtp merged commit 354c4ce into DioxusLabs:main Dec 2, 2024
16 of 17 checks passed
@ealmloff ealmloff deleted the fix-list-diffing branch December 2, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core relating to the core implementation of the virtualdom
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants