Skip to content
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

Merged
2 commits merged into from
Dec 28, 2016
Merged

[Material UI] Fix AutoComplete props #13506

2 commits merged into from
Dec 28, 2016

Conversation

CarsonF
Copy link
Contributor

@CarsonF CarsonF commented Dec 22, 2016

http://www.material-ui.com/#/components/auto-complete

Shows errorText and hintText as nodes. Data source and data item definitions were only correct if the dataSourceConfig is not used to customize the functionality.

  • Make your PR against the master branch.
  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code.
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint -- package-name if a tslint.json is present.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • Increase the version number in the header if appropriate.

@dt-bot
Copy link
Member

dt-bot commented Dec 22, 2016

material-ui/index.d.ts

to authors (@ngbrown @herrmanno). Could you review this PR?
👍 or 👎?

Checklist

  • pass the Travis CI test?

@ghost
Copy link

ghost commented Dec 28, 2016

Please rebase onto the master branch (and change the branch you're targeting; see "Edit" in the upper-right) to fix tests.

@ghost ghost added the Revision needed This PR needs code changes before it can be merged. label Dec 28, 2016
@CarsonF CarsonF changed the base branch from types-2.0 to master December 28, 2016 15:36
@CarsonF
Copy link
Contributor Author

CarsonF commented Dec 28, 2016

@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>, {}> {
Copy link

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?

Copy link
Contributor Author

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 />);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ghost ghost merged commit d89cced into DefinitelyTyped:master Dec 28, 2016
@CarsonF CarsonF deleted the mui branch December 28, 2016 16:41
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Revision needed This PR needs code changes before it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants