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

Make virtual dom cloneable #786

Merged
merged 1 commit into from
Dec 29, 2019
Merged

Make virtual dom cloneable #786

merged 1 commit into from
Dec 29, 2019

Conversation

jstarry
Copy link
Member

@jstarry jstarry commented Dec 8, 2019

Problem

Nested components are really unergonomic due to the use of a closure to wrap children virtual dom nodes in the yew macro.

Solution

Rather than use a closure, make all nodes cloneable so that there can always be a fresh copy of the child virtual dom tree when rendering the children of a nestable component.

Fixes: #785

@thienpow
Copy link

nice!

@jstarry jstarry marked this pull request as ready for review December 29, 2019 02:53
@jstarry jstarry merged commit 84a9ed0 into yewstack:master Dec 29, 2019
@jstarry jstarry deleted the vdom-clone branch December 29, 2019 02:53
llebout pushed a commit to llebout/yew that referenced this pull request Jan 20, 2020
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

Successfully merging this pull request may close these issues.

Nested component creation is unergonomic
2 participants