Fix hydration of <Routes/>

This commit is contained in:
Greg Johnston 2022-12-21 07:58:26 -05:00
parent ae82395100
commit 66ac7d2a9d

View file

@ -30,6 +30,7 @@ pub fn Routes(
});
let mut branches = Vec::new();
let id_before = HydrationCtx::peek();
let frag = children(cx);
let children = frag
.as_children()
@ -198,10 +199,8 @@ pub fn Routes(
})
});
Fragment::new_with_id(
frag.id().clone(),
vec![(move || root.get()).into_view(cx)]
)
HydrationCtx::continue_from(id_before);
(move || root.get()).into_view(cx)
}
#[derive(Clone, Debug, PartialEq)]