-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add proper typing for EuiSubNav's renderItem #1
Add proper typing for EuiSubNav's renderItem #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The work with the generic looks good. Just a couple prop type nits
interface GuaranteedRenderItemProps { | ||
href: string | undefined; | ||
onClick: ItemProps['onClick'] | undefined; | ||
className: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
className: string; | |
className?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
className
always exists when renderItem
is called (it is built up as buttonClasses
in the method)
Thanks @thompsongl, updated! |
Nice! Can I merge? |
@rlesniak go for it! After that I'll do another review pass at elastic#2818 and think it will be ready to go :) |
Adds full type definitions for
renderRender
prop. Will now error if using a prop that isn't defined, and also validates the types of those props.Using
EuiSideNavItem
directly is a bit awkward and requires explicitly typing the argument valuesBut
EuiSideNav
picks up the definitions, and this is what downstream consumers use