-
Notifications
You must be signed in to change notification settings - Fork 90
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(DropdownMenu.Item): allow usage w/out text
#406
Conversation
Preview is ready. |
|
||
type Props<T> = DropdownMenuItemType<T> & { | ||
children?: ReactNode; | ||
type Props<T> = Omit<MenuItemProps, 'onClick'> & { |
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.
these changes should be made on the exported props type in ./types
type Props<T> = DropdownMenuItemType<T> & { | ||
children?: ReactNode; | ||
}; | ||
type Props<T> = Omit<MenuItemProps, 'onClick'> & Partial<DropdownMenuItemRequiredProps<T>>; |
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.
if the original DropdownMenuItem
type changes in the way it picks props from MenuItemProps
or some other way, we'll have to sync it with this type, which is inconvenient, if not a source of errors
why not do exactly what the title of the PR reads:
type Props<T> = Omit<DropdownMenuItem<T>, 'text'> & {
text?: DropdownMenuItem<T>['text'];
children?: ReactNode;
};
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 resolves text
as required
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.
it's strange, tried it out, seems to work
can you show your code?
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.
seems like i was confused by some WS checks
07f6ced
to
383bb9d
Compare
No description provided.