yew
yew copied to clipboard
Implementing change for children
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)?
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.