@@ -764,11 +764,11 @@ hydrateElement elementTag cfg child = do
764764 }
765765 result <- HydrationDomBuilderT $ lift $ runReaderT (unHydrationDomBuilderT child) env'
766766 wrapResult <- liftIO newEmptyMVar
767− let ssrAttr = "data-ssr" :: DOM.JSString
768− hasSSRAttribute :: DOM.Element -> HydrationRunnerT t m Bool
769− hasSSRAttribute e = case cfg ^. namespace of
770− Nothing -> hasAttribute e ssrAttr <* removeAttribute e ssrAttr
771− Just ns -> hasAttributeNS e (Just ns) ssrAttr <* removeAttributeNS e (Just ns) ssrAttr
767+ let skipAttr = "data-hydration-skip" :: DOM.JSString
768+ hasSkipAttribute :: DOM.Element -> HydrationRunnerT t m Bool
769+ hasSkipAttribute e = case cfg ^. namespace of
770+ Nothing -> hasAttribute e skipAttr
771+ Just ns -> hasAttributeNS e (Just ns) skipAttr
772772 childDom <- liftIO $ readIORef childDelayedRef
773773 let rawCfg = extractRawElementConfig cfg
774774 doc <- askDocument
@@ -783,9 +783,9 @@ hydrateElement elementTag cfg child = do
783783 pure e
784784 Just node -> DOM.castTo DOM.Element node >>= \case
785785 Nothing -> go (Just node) -- this node is not an element, skip
786− Just e -> hasSSRAttribute e >>= \case
787− False -> go (Just node) -- this element was not added by the static renderer, skip
788− True -> do
786+ Just e -> hasSkipAttribute e >>= \case
787+ True -> go (Just node) -- this element is explicitly marked for being skipped by hydration
788+ False -> do
789789 t <- Element.getTagName e
790790 -- TODO: check attributes?
791791 if T.toCaseFold elementTag == T.toCaseFold t