sentry icon indicating copy to clipboard operation
sentry copied to clipboard

types(compact-select): Ensure that onChange type is inferred properly [UP-141]

Open malwilley opened this issue 2 years ago • 0 comments

The types in <CompactSelect /> are such that onChange always gets inferred as (value: any) => void. These changes make sure that the typings are correct.

To do this, I also had to use conditional typing for the multiple prop since that changes the type of the onChange argument to an array.

Other file changes are to fix consumers of CompactSelect that weren't typed narrowly enough.

Before:

image

After:

image

w/ multiple

image

malwilley avatar Sep 19 '22 23:09 malwilley