Skip to content

Commit 6addc91

Browse files
committed
added hook state for providers in provCon container
1 parent 4da2415 commit 6addc91

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/app/containers/ProvConContainer.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const ProvConContainer = (props: ProvConContainerProps): JSX.Element => {
4545
return null;
4646
};
4747
const contextProvidersOnly = keepContextAndProviderNodes(currentSnapshot);
48+
console.log('before', contextProvidersOnly);
4849

4950
const filterComponentProperties = (node: any): FilteredNode | null => {
5051
if (!node) return null;
@@ -74,7 +75,7 @@ const ProvConContainer = (props: ProvConContainerProps): JSX.Element => {
7475
if (node.props && !isEmptyObject(node.props)) {
7576
Object.entries(node.props).forEach(([key, value]) => {
7677
if (!isEmptyObject(value)) {
77-
filteredNode[`prop_${key}`] = value;
78+
filteredNode[`${key}`] = value;
7879
}
7980
});
8081
}
@@ -108,12 +109,8 @@ const ProvConContainer = (props: ProvConContainerProps): JSX.Element => {
108109
}
109110

110111
// Flatten root level hooksState if it exists
111-
if (node.hooksState && !isEmptyObject(node.hooksState)) {
112-
Object.entries(node.hooksState).forEach(([key, value]) => {
113-
if (!isEmptyObject(value)) {
114-
filteredNode[`hook_${key}`] = value;
115-
}
116-
});
112+
if (node.componentData.hooksState && !isEmptyObject(node.componentData.hooksState)) {
113+
filteredNode['State'] = node.componentData.hooksState;
117114
}
118115

119116
// Process children and add them using the node's name as the key

0 commit comments

Comments
 (0)