Skip to content

Type error in image-crop.tsx #15

@javier-godoy

Description

@javier-godoy

Describe the bug

[ERROR] src/main/frontend/src/image-crop.tsx(51,8): error TS2769: No overload matches this call.
[ERROR]   Overload 1 of 2, '(crop: Pick<PercentCrop, "unit"> & Partial<Omit<PercentCrop, "unit">>, aspect: number, containerWidth: number, containerHeight: number): PercentCrop', gave the following error.
[ERROR]     Type '"px" | "%"' is not assignable to type '"%"'.
[ERROR]       Type '"px"' is not assignable to type '"%"'.
[ERROR]   Overload 2 of 2, '(crop: Pick<PixelCrop, "unit"> & Partial<Omit<PixelCrop, "unit">>, aspect: number, containerWidth: number, containerHeight: number): PixelCrop', gave the following error.
[ERROR]     Type '"px" | "%"' is not assignable to type '"px"'.
[ERROR]       Type '"%"' is not assignable to type '"px"'.

Expected behavior

Source code should compile

Minimal reproducible example

Please find attached (check the sources under src/main/frontend).
ImageCrop.zip

Add-on Version

1.1.1-SNAPSHOT

Vaadin Version

24.6.5

Additional information

See https://github.com/dominictobias/react-image-crop/blob/e9220b188295663a55bc08c4d6efd63077e01c22/src/utils.ts#L23

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions