restoreDeletedValuesInNestedArray() — react Function Reference
Architecture documentation for the restoreDeletedValuesInNestedArray() function in ReactNativeAttributePayload.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD e0202cec_6cf7_dc4a_22b4_c95465690614["restoreDeletedValuesInNestedArray()"] 3429d3f6_3e01_954f_bb31_157d6bedf858["ReactNativeAttributePayload.js"] e0202cec_6cf7_dc4a_22b4_c95465690614 -->|defined in| 3429d3f6_3e01_954f_bb31_157d6bedf858 09e35162_fc97_6f1c_4f2a_776eeef412d0["diffProperties()"] 09e35162_fc97_6f1c_4f2a_776eeef412d0 -->|calls| e0202cec_6cf7_dc4a_22b4_c95465690614 style e0202cec_6cf7_dc4a_22b4_c95465690614 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-native-renderer/src/ReactNativeAttributePayload.js lines 50–109
function restoreDeletedValuesInNestedArray(
updatePayload: Object,
node: NestedNode,
validAttributes: AttributeConfiguration,
) {
if (isArray(node)) {
let i = node.length;
while (i-- && removedKeyCount > 0) {
restoreDeletedValuesInNestedArray(
updatePayload,
node[i],
validAttributes,
);
}
} else if (node && removedKeyCount > 0) {
const obj = node;
for (const propKey in removedKeys) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
if (!removedKeys[propKey]) {
continue;
}
let nextProp = obj[propKey];
if (nextProp === undefined) {
continue;
}
const attributeConfig = validAttributes[propKey];
if (!attributeConfig) {
continue; // not a valid native prop
}
if (typeof nextProp === 'function') {
// $FlowFixMe[incompatible-type] found when upgrading Flow
nextProp = true;
}
if (typeof nextProp === 'undefined') {
// $FlowFixMe[incompatible-type] found when upgrading Flow
nextProp = null;
}
if (typeof attributeConfig !== 'object') {
// case: !Object is the default case
updatePayload[propKey] = nextProp;
} else if (
typeof attributeConfig.diff === 'function' ||
typeof attributeConfig.process === 'function'
) {
// case: CustomAttributeConfiguration
const nextValue =
typeof attributeConfig.process === 'function'
? attributeConfig.process(nextProp)
: nextProp;
updatePayload[propKey] = nextValue;
}
// $FlowFixMe[incompatible-use] found when upgrading Flow
removedKeys[propKey] = false;
removedKeyCount--;
}
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does restoreDeletedValuesInNestedArray() do?
restoreDeletedValuesInNestedArray() is a function in the react codebase, defined in packages/react-native-renderer/src/ReactNativeAttributePayload.js.
Where is restoreDeletedValuesInNestedArray() defined?
restoreDeletedValuesInNestedArray() is defined in packages/react-native-renderer/src/ReactNativeAttributePayload.js at line 50.
What calls restoreDeletedValuesInNestedArray()?
restoreDeletedValuesInNestedArray() is called by 1 function(s): diffProperties.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free