Skip to content

Commit 0d149b1

Browse files
committed
Add component stack to previously missed hydrate warnings (#10085)
1 parent 554fcb1 commit 0d149b1

File tree

2 files changed

+85
-82
lines changed

2 files changed

+85
-82
lines changed

packages/react-dom/src/client/ReactDOMFiberComponent.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,9 +1115,10 @@ export function warnForDeletedHydratableElement(
11151115
didWarnInvalidHydration = true;
11161116
warning(
11171117
false,
1118-
'Did not expect server HTML to contain a <%s> in <%s>.',
1118+
'Did not expect server HTML to contain a <%s> in <%s>.%s',
11191119
child.nodeName.toLowerCase(),
11201120
parentNode.nodeName.toLowerCase(),
1121+
getStack(),
11211122
);
11221123
}
11231124
}
@@ -1133,9 +1134,10 @@ export function warnForDeletedHydratableText(
11331134
didWarnInvalidHydration = true;
11341135
warning(
11351136
false,
1136-
'Did not expect server HTML to contain the text node "%s" in <%s>.',
1137+
'Did not expect server HTML to contain the text node "%s" in <%s>.%s',
11371138
child.nodeValue,
11381139
parentNode.nodeName.toLowerCase(),
1140+
getStack(),
11391141
);
11401142
}
11411143
}
@@ -1178,9 +1180,10 @@ export function warnForInsertedHydratedText(
11781180
didWarnInvalidHydration = true;
11791181
warning(
11801182
false,
1181-
'Expected server HTML to contain a matching text node for "%s" in <%s>.',
1183+
'Expected server HTML to contain a matching text node for "%s" in <%s>.%s',
11821184
text,
11831185
parentNode.nodeName.toLowerCase(),
1186+
getStack(),
11841187
);
11851188
}
11861189
}

0 commit comments

Comments
 (0)