diff --git a/src/app/page.tsx b/src/app/page.tsx index eebae9f..6579aa8 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -14,7 +14,7 @@ fal.config({ const shapeUtils = [LiveImageShapeUtil]; export default function Home() { - const onEditorMount = useCallback((editor: Editor) => { + const onEditorMount = (editor: Editor) => { // If there isn't a live image shape, create one const liveImage = editor.getCurrentPageShapes().find((shape) => { return shape.type === "live-image"; @@ -29,7 +29,7 @@ export default function Home() { x: 120, y: 180, }); - }, []); + }; return (
diff --git a/src/components/live-image.tsx b/src/components/live-image.tsx index 48bbae4..bd81f45 100644 --- a/src/components/live-image.tsx +++ b/src/components/live-image.tsx @@ -156,12 +156,7 @@ type LiveImageShape = TLBaseShape<"live-image", { w: number; h: number }>; export class LiveImageShapeUtil extends ShapeUtil { static override type = "live-image" as const; - override canReceiveNewChildrenOfType = ( - shape: LiveImageShape, - type: TLShape["type"] - ) => { - return true; - }; + override canResize = () => false; getDefaultProps(): LiveImageShape["props"] { return {