Skip to content

Commit 35204e3

Browse files
Push pull renderer bug solved (#737)
* Checked if canvas zone renderer has children and set it for the first time if it has * Setting initial value for children in Parent Renderer and Repeating Renderer --------- Co-authored-by: Jonathan Alvares <alvaresjonathan599@gmail.com>
1 parent b965359 commit 35204e3

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

‎packages/atri-app-core/src/editor-components/CanvasZoneRenderer/hooks/useCanvasZoneEventSubscriber.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,11 @@ export function useCanvasZoneEventSubscriber(params: { canvasZoneId: string }) {
2727
}
2828
);
2929
}, []);
30+
useEffect(() => {
31+
if (componentStoreApi.getCanvasZoneChildrenId(params.canvasZoneId))
32+
setChildCompIds([
33+
...componentStoreApi.getCanvasZoneChildrenId(params.canvasZoneId),
34+
]);
35+
}, [params.canvasZoneId]);
3036
return { childCompIds };
3137
}

‎packages/atri-app-core/src/editor-components/ParentComponentRenderer/hooks/useHandleNewChild.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,10 @@ export function useHandleNewChild(props: { id: string }) {
2222
);
2323
});
2424

25+
useEffect(() => {
26+
if (componentStoreApi.getComponentChildrenId(props.id))
27+
setChildren([...componentStoreApi.getComponentChildrenId(props.id)]);
28+
}, [props.id]);
29+
2530
return { children };
2631
}

0 commit comments

Comments
 (0)