mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 09:54:41 -05:00
fix: update svg::InertElement for dom cache. (#4100)
#4099 introduced caching for inert elements, changing the API for [`dom::Dom::create_element_from_html`](30b0a579ca/tachys/src/renderer/dom.rs (L495)). This updates `svg::InertElement` to match the new API.
This commit is contained in:
@@ -229,14 +229,14 @@ impl Render for InertElement {
|
||||
type State = InertElementState;
|
||||
|
||||
fn build(self) -> Self::State {
|
||||
let el = Rndr::create_element_from_html(&self.html);
|
||||
let el = Rndr::create_element_from_html(self.html.clone());
|
||||
InertElementState(self.html, el)
|
||||
}
|
||||
|
||||
fn rebuild(self, state: &mut Self::State) {
|
||||
let InertElementState(prev, el) = state;
|
||||
if &self.html != prev {
|
||||
let mut new_el = Rndr::create_element_from_html(&self.html);
|
||||
let mut new_el = Rndr::create_element_from_html(self.html.clone());
|
||||
el.insert_before_this(&mut new_el);
|
||||
el.unmount();
|
||||
*el = new_el;
|
||||
|
||||
Reference in New Issue
Block a user