-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript: need data-test-subj prop available to set on some eui types (or maybe all?) #950
Comments
@stacey-gammon Out of curiosity, does it not work to change it from a string Or maybe it's different with TS... |
Oh interesting, I didn't know that. Still unfortunately looks like it doesn't work with typescript:
|
I'm not sure where that is coded, if it's part of the JSX ts interface or deeper in typescript. I think the first step would be to play with declaring the EUI component as one or more of the JSX interfaces/classes. The intrinsic JSX elements (those that are specified lowercase) all include |
Alternatively, we could shift from using |
@stacey-gammon looks like, in this instance, the context_menu/index.d.ts line 58 export interface EuiContextMenuItemProps {
icon?: EuiContextMenuItemIcon;
hasPanel?: boolean;
buttonRef?: RefCallback<HTMLButtonElement>;
} to export interface EuiContextMenuItemProps extends CommonProps {
icon?: EuiContextMenuItemIcon;
hasPanel?: boolean;
buttonRef?: RefCallback<HTMLButtonElement>;
}
|
Yes that worked @chandlerprall! Now I get an error about |
And onClick too. I have this so far:
|
@stacey-gammon would you mind creating a PR with those changes? |
Yea, I can do that, but I wanted to fix everything I needed in one PR and I am blocked right now on #985 |
tl;dr I think Icons should be allowed to be non-react so plugins don't have to be written in react. But the given types, i think force them to be react ( |
Thanks! I'll be making related changes in another component later today which should influence how to pass |
Looks like I can't add
data-test-subj
without typescript complaining. I'm thinking we need a more general way of allowing this and other html default props to be passed along.The text was updated successfully, but these errors were encountered: