-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix(tab):id attribute added to tab wrapper #224
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.
@tatata96 I think it looks good, just I was thinking if we can improve the name like tabContainerId
to be more descriptive 🤔
src/tab/Tab.tsx
Outdated
activeTabIndexFromProps === undefined | ||
? activeTabIndex | ||
: activeTabIndexFromProps |
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 indentation doesn't look correct,
content of []
should be deeper, why was it changed in the first place? 🤔 I believe we already have eslint rules for the toolkit, it should take care of this.
Same for the diff in ControlledTabProps
src/tab/Tab.tsx
Outdated
// if one of the controlled tab props are present | ||
// other controlled tab prop is required | ||
// and initialActiveTabIndex should be undefined | ||
type ControlledTabProps = | ||
| { | ||
activeTabIndex: number; | ||
onTabChange: (index: number) => void; | ||
initialActiveTabIndex?: number; | ||
} | ||
activeTabIndex: number; | ||
onTabChange: (index: number) => void; | ||
initialActiveTabIndex?: number; | ||
} | ||
| { | ||
activeTabIndex?: number; | ||
onTabChange?: (index: number) => void; | ||
}; | ||
activeTabIndex?: number; | ||
onTabChange?: (index: number) => void; | ||
}; |
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.
This is totally unrelated to the issue, but I was trying to understand this comment and the type and I couldn't.
Do you (or anyone) know what is our purpose with this type? Why do we need the second part?
activeTabIndex?: number;
onTabChange?: (index: number) => void;
(BTW, code formatting here also looks weird as I mentioned in the other comment)
Related Issue;