commercetools / ui-kit

Component library 💅
https://uikit.commercetools.com
MIT License
144 stars 25 forks source link

<AsyncSelectInput> expose generics of the underlying `AsyncSelect` from `react-select/async` component #2963

Open ragafus opened 1 day ago

ragafus commented 1 day ago

The component AsyncSelectInput is hardcoding the generics that AsyncSelect from react-select/async component exposes (see current ReactSelectAsyncProps type). Due to this fact, the consumers of AsyncSelectInput using TypeScript need to cast some of the props of the component. See this example in DIscounts app.

To solve the issue, AsyncSelectInput, SearchSelectInput, and SearchSelectField should properly use the generics react-select/async provides.

ragafus commented 1 day ago

I've created the following PR as an initial step to solve the issue. Feel free to close it if is not helpful.