Open
Description
I was trying to implement custom Selectbox
with icons instead of text and faced a lot of design problems:
- The styling for the component is completely solid. You can't separate it into different css modules like it's implemented in other components (
NumericStepper
, for example). That leads us into the problem I faced: when you need to overload theAnchor
, you need to usetheme
prop, that depends on theme you provide inside theSelectbox
and create themable component. Selectbox
'sonValueChange
handler acceptsstring | number | undefined
type and I need to implement the function with the same signature and then cast/check types. Maybe, generics here could work better. For example, I could use string literals union type to represent my options, and I'm eager to work with this and only this set of values.- The
Anchor
component acceptsvalue
prop asReactText
type. In my case I expect it to be just string or string literal, as soon as I'm overloading theAnchor
component. So again, I need to cast types there, but it could also be generic like I mentioned above.