getDerivedStateFromProps() — react Function Reference
Architecture documentation for the getDerivedStateFromProps() function in ReactIncrementalUpdates-test.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 20196449_b438_6018_a033_eb7b692a1c2d["getDerivedStateFromProps()"] 7ef4f7c9_c41b_51fd_32f8_867032830d89["App"] 20196449_b438_6018_a033_eb7b692a1c2d -->|defined in| 7ef4f7c9_c41b_51fd_32f8_867032830d89 460d87fe_80e3_aab3_286b_84787146278c["getDerivedStateFromProps()"] 460d87fe_80e3_aab3_286b_84787146278c -->|calls| 20196449_b438_6018_a033_eb7b692a1c2d 460d87fe_80e3_aab3_286b_84787146278c["getDerivedStateFromProps()"] 20196449_b438_6018_a033_eb7b692a1c2d -->|calls| 460d87fe_80e3_aab3_286b_84787146278c style 20196449_b438_6018_a033_eb7b692a1c2d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js lines 649–660
static getDerivedStateFromProps(props, state) {
// Add 100 whenever the label prop changes. The prev label is stored
// in state. If the state is dropped incorrectly, we'll fail to detect
// prop changes.
if (props.prop !== state.prevProp) {
return {
prevProp: props.prop,
count: state.count + 100,
};
}
return null;
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does getDerivedStateFromProps() do?
getDerivedStateFromProps() is a function in the react codebase, defined in packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js.
Where is getDerivedStateFromProps() defined?
getDerivedStateFromProps() is defined in packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js at line 649.
What does getDerivedStateFromProps() call?
getDerivedStateFromProps() calls 1 function(s): getDerivedStateFromProps.
What calls getDerivedStateFromProps()?
getDerivedStateFromProps() is called by 1 function(s): getDerivedStateFromProps.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free