We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 427f680 commit 0182283Copy full SHA for 0182283
frontend/src/Editor/SubContainer.jsx
@@ -39,10 +39,12 @@ export const SubContainer = ({
39
const [_containerCanvasWidth, setContainerCanvasWidth] = useState(0);
40
41
useEffect(() => {
42
- const canvasWidth = parentRef?.current ? getContainerCanvasWidth() : 0;
43
- setContainerCanvasWidth(canvasWidth);
+ if (parentRef.current) {
+ const canvasWidth = getContainerCanvasWidth();
44
+ setContainerCanvasWidth(canvasWidth);
45
+ }
46
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [parentRef.current]);
47
+ }, [parentRef, getContainerCanvasWidth()]);
48
49
zoomLevel = zoomLevel || 1;
50
0 commit comments