makeIfConsequent() — react Function Reference
Architecture documentation for the makeIfConsequent() function in code-path-state.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 747e38ff_afa2_6314_d554_04624db30f3e["makeIfConsequent()"] d3cee22c_5e2d_f853_c075_2c7c55e5d22c["CodePathState"] 747e38ff_afa2_6314_d554_04624db30f3e -->|defined in| d3cee22c_5e2d_f853_c075_2c7c55e5d22c style 747e38ff_afa2_6314_d554_04624db30f3e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js lines 507–526
makeIfConsequent() {
const context = this.choiceContext;
const forkContext = this.forkContext;
/*
* If any result were not transferred from child contexts,
* this sets the head segments to both cases.
* The head segments are the path of the test expression.
*/
if (!context.processed) {
context.trueForkContext.add(forkContext.head);
context.falseForkContext.add(forkContext.head);
context.qqForkContext.add(forkContext.head);
}
context.processed = false;
// Creates new path from the `true` case.
forkContext.replaceHead(context.trueForkContext.makeNext(0, -1));
}
Domain
Subdomains
Source
Frequently Asked Questions
What does makeIfConsequent() do?
makeIfConsequent() is a function in the react codebase, defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js.
Where is makeIfConsequent() defined?
makeIfConsequent() is defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js at line 507.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free