FIx issues I introduced to SSR while logging this

This commit is contained in:
Greg Johnston 2022-12-15 21:04:55 -05:00
parent fefca82d16
commit c6d30a710a
2 changed files with 5 additions and 1 deletions

View file

@ -128,6 +128,8 @@ impl ComponentRepr {
let name = name.into();
let id = HydrationCtx::id();
#[cfg(all(target_arch = "wasm32", feature = "web"))]
gloo::console::warn!("hydrating <", name.to_string(), "/> with id ", id);
let markers = (
@ -144,7 +146,6 @@ impl ComponentRepr {
// so they can serve as our references when inserting
// future nodes
if !HydrationCtx::is_hydrating() {
gloo::console::warn!(" rendering <{name}/>");
#[cfg(debug_assertions)]
fragment
.append_with_node_2(&markers.1.node, &markers.0.node)

View file

@ -647,6 +647,9 @@ macro_rules! generate_html_tags {
fn default() -> Self {
let id = HydrationCtx::id();
#[cfg(all(target_arch = "wasm32", feature = "web"))]
gloo::console::warn!("hydrating <",stringify!([<$tag:upper>]), "/> with id ", id);
#[cfg(all(target_arch = "wasm32", feature = "web"))]
let element = if HydrationCtx::is_hydrating() {
if let Some(el) = crate::document().get_element_by_id(