-
Notifications
You must be signed in to change notification settings - Fork 933
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
Improved typings for getMenuProps #534
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,24 +105,29 @@ export interface GetInputPropsOptions | |
export interface GetLabelPropsOptions | ||
extends React.HTMLProps<HTMLLabelElement> {} | ||
|
||
export interface getToggleButtonPropsOptions | ||
export interface GetToggleButtonPropsOptions | ||
extends React.HTMLProps<HTMLButtonElement> {} | ||
|
||
interface OptionalExtraGetItemPropsOptions { | ||
[key: string]: any | ||
export interface GetMenuPropsOptions<Item> | ||
extends Record<string, any> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem to be quite right. I also don't understand what the From looking over the docs, this is what I would expect this type to look like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are completely right. I kind of copied the interface from |
||
refKey?: string; | ||
}; | ||
|
||
export interface GetMenuPropsOtherOptions<Item> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove the |
||
suppressRefError?: boolean; | ||
} | ||
|
||
export interface GetItemPropsOptions<Item> | ||
extends OptionalExtraGetItemPropsOptions { | ||
extends Record<string, any> { | ||
index?: number | ||
item: Item | ||
} | ||
|
||
export interface PropGetters<Item> { | ||
getRootProps: (options: GetRootPropsOptions) => any | ||
getToggleButtonProps: (options?: getToggleButtonPropsOptions) => any | ||
getToggleButtonProps: (options?: GetToggleButtonPropsOptions) => any | ||
getLabelProps: (options?: GetLabelPropsOptions) => any | ||
getMenuProps: (options?: {}) => any | ||
getMenuProps: (options?: GetMenuPropsOptions<Item>, otherOptions?: GetMenuPropsOtherOptions<Item>) => any | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove the |
||
getInputProps: (options?: GetInputPropsOptions) => any | ||
getItemProps: (options: GetItemPropsOptions<Item>) => any | ||
} | ||
|
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.
👍
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.
Thanks for reviewing this PR! I've made changes as necessary and please take a look 😄