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

Implementing change for children #907

Closed
krampenschiesser opened this issue Jan 31, 2020 · 1 comment · Fixed by #916
Closed

Implementing change for children #907

krampenschiesser opened this issue Jan 31, 2020 · 1 comment · Fixed by #916
Labels
feature-request A feature request

Comments

@krampenschiesser
Copy link

Question

I am implementing a button of a third party JS framework (onsen).
Anyway a button always receives children in the form of icons or its text.
Now when I try to implement fn change(&mut self, props: Self::Properties) -> ShouldRender {
my problem is how can I check that the children didn't change?
I could render and then compare the HTML but that's excessive.
Is there any easier way (eg id'ing the children)?

@jstarry
Copy link
Member

jstarry commented Feb 2, 2020

Can't think of a better option than comparing the virtual nodes that Yew manages. It will be performant because this diff is what Yew is already doing on each render anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants