MCPcopy Index your code
hub / github.com/caseywebdev/react-list / validateTextNesting

Function validateTextNesting

docs/index.js:21195–21223  ·  view source on GitHub ↗
(childText, parentTag)

Source from the content-addressed store, hash-verified

21193 return !1;
21194 }
21195 function validateTextNesting(childText, parentTag) {
21196 if (isTagValidWithParent("#text", parentTag)) return !0;
21197 var warnKey = "#text|" + parentTag;
21198 if (didWarn[warnKey]) return !1;
21199 didWarn[warnKey] = !0;
21200 var ancestor = (warnKey = current)
21201 ? findAncestor(warnKey, parentTag)
21202 : null;
21203 warnKey =
21204 null !== warnKey && null !== ancestor
21205 ? describeAncestors(
21206 ancestor,
21207 warnKey,
21208 6 !== warnKey.tag ? { children: null } : null
21209 )
21210 : "";
21211 /\S/.test(childText)
21212 ? console.error(
21213 "In HTML, text nodes cannot be a child of <%s>.\nThis will cause a hydration error.%s",
21214 parentTag,
21215 warnKey
21216 )
21217 : console.error(
21218 "In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\nThis will cause a hydration error.%s",
21219 parentTag,
21220 warnKey
21221 );
21222 return !1;
21223 }
21224 function setTextContent(node, text) {
21225 if (text) {
21226 var firstChild = node.firstChild;

Callers 3

beginWorkFunction · 0.85
completeWorkFunction · 0.85
setPropFunction · 0.85

Calls 3

isTagValidWithParentFunction · 0.85
findAncestorFunction · 0.85
describeAncestorsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…