describeTextNode() — react Function Reference
Architecture documentation for the describeTextNode() function in ReactFiberHydrationDiffs.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 6474ef9f_4744_bb9a_3aba_8b5a81bd364e["describeTextNode()"] e98a87b8_beb4_9d09_4d2f_78427872f8a3["ReactFiberHydrationDiffs.js"] 6474ef9f_4744_bb9a_3aba_8b5a81bd364e -->|defined in| e98a87b8_beb4_9d09_4d2f_78427872f8a3 132028dc_e4a7_d8d0_d21d_ea93b0f61c4e["describeTextDiff()"] 132028dc_e4a7_d8d0_d21d_ea93b0f61c4e -->|calls| 6474ef9f_4744_bb9a_3aba_8b5a81bd364e 2bddd835_c8df_0f88_d323_52a3495a4bd7["describeNode()"] 2bddd835_c8df_0f88_d323_52a3495a4bd7 -->|calls| 6474ef9f_4744_bb9a_3aba_8b5a81bd364e style 6474ef9f_4744_bb9a_3aba_8b5a81bd364e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-reconciler/src/ReactFiberHydrationDiffs.js lines 111–130
function describeTextNode(content: string, maxLength: number): string {
if (needsEscaping.test(content)) {
const encoded = JSON.stringify(content);
if (encoded.length > maxLength - 2) {
if (maxLength < 8) {
return '{"..."}';
}
return '{' + encoded.slice(0, maxLength - 7) + '..."}';
}
return '{' + encoded + '}';
} else {
if (content.length > maxLength) {
if (maxLength < 5) {
return '{"..."}';
}
return content.slice(0, maxLength - 3) + '...';
}
return content;
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does describeTextNode() do?
describeTextNode() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberHydrationDiffs.js.
Where is describeTextNode() defined?
describeTextNode() is defined in packages/react-reconciler/src/ReactFiberHydrationDiffs.js at line 111.
What calls describeTextNode()?
describeTextNode() is called by 2 function(s): describeNode, describeTextDiff.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free