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

[typescript] Remove key prop from Snackbar #8427

Merged
merged 1 commit into from Sep 28, 2017

Conversation

TorstenStueber
Copy link
Contributor

The prop key should not be part of the Snackbar props for the following reasons:

  • key is a special prop that is automatically declared for every React component
  • key is defined to be string | number | null in general (not number as was here – way too restrictive)

The prop `key` should not be part of the Snackbar props for the following reasons:
* `key` is a special prop that is automatically declared for every React component
* `key` is defined to be `string | number | null` in general (not `number` as was here – way too restrictive)
@TorstenStueber
Copy link
Contributor Author

Sorry for bothering you with this trivial PR. It is annoying, though, as the standard use case for Snackbar key would be to use the message itself (i.e., a string).

This use case is even suggested in the comment in Snackbar.js. But maybe one should even remove the prop key in Snackbar.js as well (in accordance with the TypeScript type). I just kept it there because I found the comment (mentioned above) useful.

@sebald
Copy link
Member

sebald commented Sep 28, 2017

PRs like that are never bothering! What ever the opposite of bothering is, you're doing it! Thanks a lot for taking the time! 🙌

@sebald sebald merged commit f2aca6b into mui:v1-beta Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants