88
99import { invalidSkipHydrationHost , validateMatchingNode , validateNodeExists } from '../../hydration/error_handling' ;
1010import { locateNextRNode } from '../../hydration/node_lookup_utils' ;
11- import { hasNgSkipHydrationAttr } from '../../hydration/skip_hydration' ;
11+ import { hasSkipHydrationAttrOnRElement , hasSkipHydrationAttrOnTNode } from '../../hydration/skip_hydration' ;
1212import { getSerializedContainerViews , isDisconnectedNode , markRNodeAsClaimedByHydration , setSegmentHead } from '../../hydration/utils' ;
1313import { assertDefined , assertEqual , assertIndexInRange } from '../../util/assert' ;
1414import { assertFirstCreatePass , assertHasParent } from '../assert' ;
@@ -17,7 +17,7 @@ import {registerPostOrderHooks} from '../hooks';
1717import { hasClassInput , hasStyleInput , TAttributes , TElementNode , TNode , TNodeFlags , TNodeType } from '../interfaces/node' ;
1818import { Renderer } from '../interfaces/renderer' ;
1919import { RElement } from '../interfaces/renderer_dom' ;
20- import { isComponentHost , isContentQueryHost , isDirectiveHost } from '../interfaces/type_checks' ;
20+ import { hasI18n , isComponentHost , isContentQueryHost , isDirectiveHost } from '../interfaces/type_checks' ;
2121import { HEADER_OFFSET , HYDRATION , LView , RENDERER , TView } from '../interfaces/view' ;
2222import { assertTNodeType } from '../node_assert' ;
2323import { appendChild , clearElementContents , createElementNode , setupStaticAttributes } from '../node_manipulation' ;
@@ -230,8 +230,11 @@ function locateOrCreateElementNodeImpl(
230230 }
231231
232232 // Checks if the skip hydration attribute is present during hydration so we know to
233- // skip attempting to hydrate this block.
234- if ( hydrationInfo && hasNgSkipHydrationAttr ( tNode ) ) {
233+ // skip attempting to hydrate this block. We check both TNode and RElement for an
234+ // attribute: the RElement case is needed for i18n cases, when we add it to host
235+ // elements during the annotation phase (after all internal data structures are setup).
236+ if ( hydrationInfo &&
237+ ( hasSkipHydrationAttrOnTNode ( tNode ) || hasSkipHydrationAttrOnRElement ( native ) ) ) {
235238 if ( isComponentHost ( tNode ) ) {
236239 enterSkipHydrationBlock ( tNode ) ;
237240
0 commit comments