makeLooped() — react Function Reference
Architecture documentation for the makeLooped() function in code-path-state.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 340594f4_b9ab_167e_55a5_90de76787b13["makeLooped()"] 6e2aa007_860b_49d4_8a7b_6b55d63818e5["code-path-state.js"] 340594f4_b9ab_167e_55a5_90de76787b13 -->|defined in| 6e2aa007_860b_49d4_8a7b_6b55d63818e5 998aa69c_660b_1912_c7d1_55b3eb1f45b7["popSwitchContext()"] 998aa69c_660b_1912_c7d1_55b3eb1f45b7 -->|calls| 340594f4_b9ab_167e_55a5_90de76787b13 941f950b_cd48_1b4b_82f0_a7c8f79c78b6["popLoopContext()"] 941f950b_cd48_1b4b_82f0_a7c8f79c78b6 -->|calls| 340594f4_b9ab_167e_55a5_90de76787b13 7dfff945_2de0_14ee_52c3_45df02bdd036["makeForBody()"] 7dfff945_2de0_14ee_52c3_45df02bdd036 -->|calls| 340594f4_b9ab_167e_55a5_90de76787b13 e39a18a3_fb74_8b03_6d18_a7a8711595de["makeForInOfBody()"] e39a18a3_fb74_8b03_6d18_a7a8711595de -->|calls| 340594f4_b9ab_167e_55a5_90de76787b13 4f943365_8b3b_7c3c_592b_8fcdb92d11a2["makeContinue()"] 4f943365_8b3b_7c3c_592b_8fcdb92d11a2 -->|calls| 340594f4_b9ab_167e_55a5_90de76787b13 style 340594f4_b9ab_167e_55a5_90de76787b13 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js lines 161–190
function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) {
const fromSegments = CodePathSegment.flattenUnusedSegments(
unflattenedFromSegments,
);
const toSegments = CodePathSegment.flattenUnusedSegments(
unflattenedToSegments,
);
const end = Math.min(fromSegments.length, toSegments.length);
for (let i = 0; i < end; ++i) {
const fromSegment = fromSegments[i];
const toSegment = toSegments[i];
if (toSegment.reachable) {
fromSegment.nextSegments.push(toSegment);
}
if (fromSegment.reachable) {
toSegment.prevSegments.push(fromSegment);
}
fromSegment.allNextSegments.push(toSegment);
toSegment.allPrevSegments.push(fromSegment);
if (toSegment.allPrevSegments.length >= 2) {
CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment);
}
state.notifyLooped(fromSegment, toSegment);
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does makeLooped() do?
makeLooped() is a function in the react codebase, defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js.
Where is makeLooped() defined?
makeLooped() is defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js at line 161.
What calls makeLooped()?
makeLooped() is called by 5 function(s): makeContinue, makeForBody, makeForInOfBody, popLoopContext, popSwitchContext.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free