Skip to content

Type error in image-crop.tsx #15

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions