Skip to content

Commit

Permalink
Add missing hydration completed
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechu10 committed Apr 15, 2022
1 parent 883baba commit dbfce37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sycamore/src/html/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use wasm_bindgen::prelude::*;
use crate::generic_node::SycamoreElement;
use crate::prelude::*;
#[cfg(feature = "hydrate")]
use crate::utils::hydrate::with_no_hydration_context;
use crate::utils::hydrate::{hydration_completed, with_no_hydration_context};

/// MBE for generating elements.
macro_rules! define_elements {
Expand Down Expand Up @@ -326,7 +326,7 @@ pub fn NoHydrate<'a, G: Html>(cx: Scope<'a>, props: NoHydrateProps<'a, G>) -> Vi
// the node won't get inserted into the DOM.
div(ref=node_ref) {}
};
if G::CLIENT_SIDE_HYDRATION {
if G::CLIENT_SIDE_HYDRATION && !hydration_completed() {
// We don't want to hydrate the children, so we just do nothing.
} else if G::USE_HYDRATION_CONTEXT {
// If we have a hydration context, remove it in this scope so that hydration markers are not
Expand Down

0 comments on commit dbfce37

Please sign in to comment.