serializeHook() — react Function Reference
Architecture documentation for the serializeHook() function in hookSerializer.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 2c822004_48b4_a40e_3a8e_3ebc7aa5f69e["serializeHook()"] e2252a4e_d1c2_c24c_476b_66f81e018367["hookSerializer.js"] 2c822004_48b4_a40e_3a8e_3ebc7aa5f69e -->|defined in| e2252a4e_d1c2_c24c_476b_66f81e018367 009195ec_1136_87f3_666c_648b11f8de6f["print()"] 009195ec_1136_87f3_666c_648b11f8de6f -->|calls| 2c822004_48b4_a40e_3a8e_3ebc7aa5f69e style 2c822004_48b4_a40e_3a8e_3ebc7aa5f69e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-devtools-shared/src/__tests__/__serializers__/hookSerializer.js lines 10–35
function serializeHook(hook) {
if (!hook.hookSource) return hook;
// Remove user-specific portions of this file path.
let fileName = hook.hookSource.fileName;
const index = fileName.lastIndexOf('/react-devtools-shared/');
fileName = fileName.slice(index + 1);
let subHooks = hook.subHooks;
if (subHooks) {
subHooks = subHooks.map(serializeHook);
}
return {
...hook,
hookSource: {
...hook.hookSource,
fileName,
// Otherwise changes in any test case or formatting might invalidate other tests.
columnNumber: 'removed by Jest serializer',
lineNumber: 'removed by Jest serializer',
},
subHooks,
};
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does serializeHook() do?
serializeHook() is a function in the react codebase, defined in packages/react-devtools-shared/src/__tests__/__serializers__/hookSerializer.js.
Where is serializeHook() defined?
serializeHook() is defined in packages/react-devtools-shared/src/__tests__/__serializers__/hookSerializer.js at line 10.
What calls serializeHook()?
serializeHook() is called by 1 function(s): print.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free