Skip to content

Commit

Permalink
fix: duplicate text nodes during <For/> hydration (closes #1279) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj committed Jul 7, 2023
1 parent ee525b5 commit 620ef20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion leptos_dom/src/components/each.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,12 @@ impl EachItem {
fragment.append_with_node_1(&closing.node).unwrap();
}

mount_child(MountKind::Before(&closing.node), &child);
// if child view is Text and if we are hydrating, we do not
// need to mount it. otherwise, mount it here
if !HydrationCtx::is_hydrating() || !matches!(child, View::Text(_))
{
mount_child(MountKind::Before(&closing.node), &child);
}

Some(fragment)
} else {
Expand Down

0 comments on commit 620ef20

Please sign in to comment.