-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
[Material UI] Fix AutoComplete props #13506
Conversation
material-ui/index.d.ts to authors (@ngbrown @herrmanno). Could you review this PR? Checklist
|
Please rebase onto the |
…mNavigationItem icon and label props to be react nodes.
…g allows it to be configurable.
@andy-ms Done 😄 |
@@ -561,7 +559,7 @@ declare namespace __MaterialUI { | |||
targetOrigin?: propTypes.origin; | |||
textFieldStyle?: React.CSSProperties; | |||
} | |||
export class AutoComplete extends React.Component<AutoCompleteProps, {}> { | |||
export class AutoComplete extends React.Component<AutoCompleteProps<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.
Should this class be generic too?
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.
Yes it should, but TSX doesn't support generics yet.
Having a generic on the props allows you to hack around this and typecast with the generic.
const MyAutoComplete = AutoComplete as React.Commponent<AutoCompleteProps<MyDataItem>, {}>;
render(<MyAutoComplete />);
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.
Ah, microsoft/TypeScript#6395. OK.
http://www.material-ui.com/#/components/auto-complete
Shows
errorText
andhintText
as nodes. Data source and data item definitions were only correct if thedataSourceConfig
is not used to customize the functionality.master
branch.Runnpm run lint -- package-name
if atslint.json
is present.If changing an existing definition:
Increase the version number in the header if appropriate.