-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Allow component re-use #94
Conversation
Sorry I haven't had a chance to give this my full attention yet. I hope to investigate this on Sat/Sun. Overall it looks good, but I'd like to make sure there aren't any regressions, which is tough to do. I'd like to land some unit tests for this code (I've been working on those, but haven't pushed anything yet) |
I've pushed alternative logic for handling this, rather than jumping out of the standard loop into |
dom.go
Outdated
@@ -207,7 +207,7 @@ func (h *HTML) Restore(old ComponentOrHTML) { | |||
} | |||
} | |||
|
|||
if prev, ok := old.(*HTML); ok && prev != nil { | |||
if prev, ok := old.(*HTML); ok && prev != nil && prev.Node != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this may fix #92 as well
Partial fix for hexops#78, only allows re-use of *vecty.Component, not *vecty.HTML
I've had to revert to the original implementation, as the alternative was not reliably re-rending some children. |
Closing in favour of #107 meta-pull. |
Partial fix for #78, only allows re-use of
*vecty.Component
, not*vecty.HTML
.