fix(crop): return cropOverlayRef instead of .current to fix null timing

The cropOverlay was created asynchronously inside a polling interval but
returned synchronously as .current (null). By returning the ref itself,
Editor.tsx reads .current at call time when the overlay actually exists.
This commit is contained in:
Hiren Kangad
2026-03-11 17:39:34 +05:30
parent 01f22c9d43
commit 3413d58f83
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -458,5 +458,5 @@ export function useCanvasSetup(deps: CanvasSetupDeps) {
};
}, [boardData, resolvedBoardId, user, isPublicView, onCanvasChange, showToast, canvasRef, selectionRef, undoRef, syncRef, inboxZoneRef, uploadManager, setOnlineUsers, setSelectedLayerIds]);
return { annotationStore: annotationStoreRef.current, pinOverlay: pinOverlayRef.current, textEditor: textEditorRef.current, cropOverlay: cropOverlayRef.current };
return { annotationStore: annotationStoreRef.current, pinOverlay: pinOverlayRef.current, textEditor: textEditorRef.current, cropOverlayRef };
}