Open parkiino opened 3 years ago
@cchaos just to confirm, we want EuiBadge to work similarly to EuiButton and support both href
& onClick
props together?
Yep, that's fine. I still like our ESLint warning, but we should still allow it for special cases.
Type check fails when you have both an
onClick
prop and anhref
prop. Even if you are not usingiconOnClick
, if you have anhref
prop, type check requiresiconOnClick
andiconOnClickAriaLabel
.The EuiBadge type is inferred since type check knows it can't be an anchor because there's an onClick and it can't be a button because there's an anchor, so it must be the last type, which is iconOnClick+iconOnClickAriaLabel.