adrianhajdin / figma_clone

Figma Clone using Next.js, Fabric.js and Liveblocks in TypeScript

Home Page:https://jsmastery.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dimension error

Shashikiran200212 opened this issue · comments

image image

how to solve this errors ?
plz help @adrianhajdin

export const handleResize = ({ canvas }: { canvas: fabric.Canvas | null }) => {
  const canvasElement = document.getElementById("canvas");
  if (!canvasElement) return;

  if (!canvas) return;

  canvas.setDimensions({
    width: canvasElement.clientWidth,
    height: canvasElement.clientHeight,
  });
};