UNPKG

@tldraw/editor

Version:

tldraw infinite canvas SDK (editor).

10 lines (8 loc) 327 B
import { useValue } from '@tldraw/state-react' import { TLShapeId } from '@tldraw/tlschema' import { useEditor } from './useEditor' /** @public */ export function useIsCropping(shapeId: TLShapeId) { const editor = useEditor() return useValue('isCropping', () => editor.getCroppingShapeId() === shapeId, [editor, shapeId]) }