Rename to replace_body for clarity
@@ -24,7 +24,7 @@ where
/// root of the HTML generated by its `view` method. Use this method when you
/// need to manipulate the body element. For example, adding/removing app-wide
/// CSS classes of the body element.
- pub fn mount_body(self) -> Scope<COMP> {
+ pub fn replace_body(self) -> Scope<COMP> {
let html_element = document()
.query_selector("html")
.expect("can't get html node for rendering")
@@ -33,7 +33,9 @@ where
.query_selector("body")
.expect("can't get body node for rendering")
.expect("can't unwrap body node");
- html_element.remove_child(&body_element).expect("can't remove body child");
+ html_element
+ .remove_child(&body_element)
+ .expect("can't remove body child");
self.scope.mount_in_place(html_element, None, None, None)
}
