mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
fixed panic on DynChild
for double taking an option
This commit is contained in:
parent
e641108ed3
commit
21716ea59d
2 changed files with 11 additions and 10 deletions
|
@ -1,3 +1,5 @@
|
|||
#![allow(warnings)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
|
@ -22,16 +24,16 @@ fn main() {
|
|||
.finish()
|
||||
.init();
|
||||
|
||||
// mount_to_body(view_fn);
|
||||
mount_to_body(view_fn);
|
||||
|
||||
let disposer =
|
||||
leptos_reactive::create_scope(leptos_reactive::create_runtime(), |cx| {
|
||||
let view = view_fn(cx).into_view(cx);
|
||||
// let disposer =
|
||||
// leptos_reactive::create_scope(leptos_reactive::create_runtime(), |cx| {
|
||||
// let view = view_fn(cx).into_view(cx);
|
||||
|
||||
let render = view.render_to_string();
|
||||
// let render = view.render_to_string();
|
||||
|
||||
println!("{render}");
|
||||
});
|
||||
// println!("{render}");
|
||||
// });
|
||||
}
|
||||
|
||||
fn view_fn(cx: Scope) -> impl IntoView {
|
||||
|
@ -112,10 +114,10 @@ fn view_fn(cx: Scope) -> impl IntoView {
|
|||
.child(text("Click me (undelegated)"))
|
||||
.into_view(cx),
|
||||
pre(cx)
|
||||
.child(EachKey::new(
|
||||
.child(Each::new(
|
||||
iterable,
|
||||
|i| *i,
|
||||
move |i| text(format!("{i}, ")),
|
||||
move |cx, i| text(format!("{i}, ")),
|
||||
))
|
||||
.into_view(cx),
|
||||
pre(cx)
|
||||
|
|
|
@ -167,7 +167,6 @@ where
|
|||
} else {
|
||||
if !HydrationCtx::is_hydrating() {
|
||||
// Remove the child
|
||||
let child = child_borrow.take().unwrap();
|
||||
|
||||
let start = child.get_opening_node();
|
||||
let end = &closing;
|
||||
|
|
Loading…
Reference in a new issue