{"action":"created","comment":{"url":"https://api.github.com/repos/mui-org/material-ui/pulls/comments/181559081","pull_request_review_id":112214644,"id":181559081,"diff_hunk":"@@ -28,19 +30,22 @@ export interface WithStylesOptions {\n \n export type ClassNameMap<ClassKey extends string = string> = Record<ClassKey, string>;\n \n-export interface WithStyles<ClassKey extends string = string> {\n+export interface WithStyles<ClassKey extends string = string> extends Partial<WithTheme> {\n   classes: ClassNameMap<ClassKey>;\n-  theme?: Theme;\n }\n \n export interface StyledComponentProps<ClassKey extends string = string> {\n   classes?: Partial<ClassNameMap<ClassKey>>;\n   innerRef?: React.Ref<any>;\n }\n \n+/*\n+  The Omit<P, 'classes'> below (rather than the canonical Omit<P, WithStyles<ClassKey>>)\n+  is used to allow interoperability with withTheme, which may provide the 'theme' prop.\n+ */\n export default function withStyles<ClassKey extends string>(\n   style: StyleRules<ClassKey> | StyleRulesCallback<ClassKey>,\n   options?: WithStylesOptions,\n-): <P>(\n-  component: React.ComponentType<P & WithStyles<ClassKey>>,\n-) => React.ComponentType<P & StyledComponentProps<ClassKey>>;\n+): <P extends WithStyles<ClassKey>>(\n+  component: React.ComponentType<P>,\n+) => React.ComponentType<Omit<P, 'classes'> & StyledComponentProps<ClassKey>>;","path":"src/styles/withStyles.d.ts","position":34,"original_position":34,"commit_id":"175fa4944fc8f8e8bbc672e25a4a3ccc44000626","original_commit_id":"175fa4944fc8f8e8bbc672e25a4a3ccc44000626","user":{"login":"pelotom","id":128019,"avatar_url":"https://avatars2.githubusercontent.com/u/128019?v=4","gravatar_id":"","url":"https://api.github.com/users/pelotom","html_url":"https://github.com/pelotom","followers_url":"https://api.github.com/users/pelotom/followers","following_url":"https://api.github.com/users/pelotom/following{/other_user}","gists_url":"https://api.github.com/users/pelotom/gists{/gist_id}","starred_url":"https://api.github.com/users/pelotom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelotom/subscriptions","organizations_url":"https://api.github.com/users/pelotom/orgs","repos_url":"https://api.github.com/users/pelotom/repos","events_url":"https://api.github.com/users/pelotom/events{/privacy}","received_events_url":"https://api.github.com/users/pelotom/received_events","type":"User","site_admin":false},"body":"I think there's some merit here, but `P` should not be _required_ to included a `classes` prop. Instead it should be required that if `P` _does_ include a `classes` prop, it should have the right type. Something like this:\r\n\r\n```ts\r\ninterface MaybeWithStyles extends Partial<WithStyles<ClassKey>> {\r\n  [k: string]: any;\r\n}\r\n\r\nexport default function withStyles<ClassKey extends string>(\r\n  style: StyleRules<ClassKey> | StyleRulesCallback<ClassKey>,\r\n  options?: WithStylesOptions,\r\n): <P extends MaybeWithStyles<ClassKey>>(\r\n  component: React.ComponentType<P & WithStyles<ClassKey>>,\r\n) => React.ComponentType<Omit<P, 'classes'> & StyledComponentProps<ClassKey>>;\r\n```\r\n","created_at":"2018-04-14T17:56:21Z","updated_at":"2018-04-14T17:56:28Z","html_url":"https://github.com/mui-org/material-ui/pull/11003#discussion_r181559081","pull_request_url":"https://api.github.com/repos/mui-org/material-ui/pulls/11003","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mui-org/material-ui/pulls/comments/181559081"},"html":{"href":"https://github.com/mui-org/material-ui/pull/11003#discussion_r181559081"},"pull_request":{"href":"https://api.github.com/repos/mui-org/material-ui/pulls/11003"}}},"pull_request":{"url":"https://api.github.com/repos/mui-org/material-ui/pulls/11003","id":181204979,"html_url":"https://github.com/mui-org/material-ui/pull/11003","diff_url":"https://github.com/mui-org/material-ui/pull/11003.diff","patch_url":"https://github.com/mui-org/material-ui/pull/11003.patch","issue_url":"https://api.github.com/repos/mui-org/material-ui/issues/11003","number":11003,"state":"open","locked":false,"title":"Use Omit for withStyles, withTheme, withWidth Typescript declarations","user":{"login":"estaub","id":1131334,"avatar_url":"https://avatars1.githubusercontent.com/u/1131334?v=4","gravatar_id":"","url":"https://api.github.com/users/estaub","html_url":"https://github.com/estaub","followers_url":"https://api.github.com/users/estaub/followers","following_url":"https://api.github.com/users/estaub/following{/other_user}","gists_url":"https://api.github.com/users/estaub/gists{/gist_id}","starred_url":"https://api.github.com/users/estaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estaub/subscriptions","organizations_url":"https://api.github.com/users/estaub/orgs","repos_url":"https://api.github.com/users/estaub/repos","events_url":"https://api.github.com/users/estaub/events{/privacy}","received_events_url":"https://api.github.com/users/estaub/received_events","type":"User","site_admin":false},"body":"UPDATED\r\nThe current structure of withStyles, withTheme, and withWidth forces use of a generic parameter to describe the component's properties without the injected properties.\r\n\r\nThis changes the generic parameter to reflect the entire props of the inner component, so that it can be inferred from the passed component.  \r\n","created_at":"2018-04-12T13:34:58Z","updated_at":"2018-04-14T17:56:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93bd1ca58b696115243146506dcf91ccc018913a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":672358040,"url":"https://api.github.com/repos/mui-org/material-ui/labels/typescript","name":"typescript","color":"006b75","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mui-org/material-ui/pulls/11003/commits","review_comments_url":"https://api.github.com/repos/mui-org/material-ui/pulls/11003/comments","review_comment_url":"https://api.github.com/repos/mui-org/material-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mui-org/material-ui/issues/11003/comments","statuses_url":"https://api.github.com/repos/mui-org/material-ui/statuses/175fa4944fc8f8e8bbc672e25a4a3ccc44000626","head":{"label":"estaub:patch-1","ref":"patch-1","sha":"175fa4944fc8f8e8bbc672e25a4a3ccc44000626","user":{"login":"estaub","id":1131334,"avatar_url":"https://avatars1.githubusercontent.com/u/1131334?v=4","gravatar_id":"","url":"https://api.github.com/users/estaub","html_url":"https://github.com/estaub","followers_url":"https://api.github.com/users/estaub/followers","following_url":"https://api.github.com/users/estaub/following{/other_user}","gists_url":"https://api.github.com/users/estaub/gists{/gist_id}","starred_url":"https://api.github.com/users/estaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estaub/subscriptions","organizations_url":"https://api.github.com/users/estaub/orgs","repos_url":"https://api.github.com/users/estaub/repos","events_url":"https://api.github.com/users/estaub/events{/privacy}","received_events_url":"https://api.github.com/users/estaub/received_events","type":"User","site_admin":false},"repo":{"id":129253934,"name":"material-ui","full_name":"estaub/material-ui","owner":{"login":"estaub","id":1131334,"avatar_url":"https://avatars1.githubusercontent.com/u/1131334?v=4","gravatar_id":"","url":"https://api.github.com/users/estaub","html_url":"https://github.com/estaub","followers_url":"https://api.github.com/users/estaub/followers","following_url":"https://api.github.com/users/estaub/following{/other_user}","gists_url":"https://api.github.com/users/estaub/gists{/gist_id}","starred_url":"https://api.github.com/users/estaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estaub/subscriptions","organizations_url":"https://api.github.com/users/estaub/orgs","repos_url":"https://api.github.com/users/estaub/repos","events_url":"https://api.github.com/users/estaub/events{/privacy}","received_events_url":"https://api.github.com/users/estaub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/estaub/material-ui","description":"React components that implement Google's Material Design.","fork":true,"url":"https://api.github.com/repos/estaub/material-ui","forks_url":"https://api.github.com/repos/estaub/material-ui/forks","keys_url":"https://api.github.com/repos/estaub/material-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/estaub/material-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/estaub/material-ui/teams","hooks_url":"https://api.github.com/repos/estaub/material-ui/hooks","issue_events_url":"https://api.github.com/repos/estaub/material-ui/issues/events{/number}","events_url":"https://api.github.com/repos/estaub/material-ui/events","assignees_url":"https://api.github.com/repos/estaub/material-ui/assignees{/user}","branches_url":"https://api.github.com/repos/estaub/material-ui/branches{/branch}","tags_url":"https://api.github.com/repos/estaub/material-ui/tags","blobs_url":"https://api.github.com/repos/estaub/material-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/estaub/material-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/estaub/material-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/estaub/material-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/estaub/material-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/estaub/material-ui/languages","stargazers_url":"https://api.github.com/repos/estaub/material-ui/stargazers","contributors_url":"https://api.github.com/repos/estaub/material-ui/contributors","subscribers_url":"https://api.github.com/repos/estaub/material-ui/subscribers","subscription_url":"https://api.github.com/repos/estaub/material-ui/subscription","commits_url":"https://api.github.com/repos/estaub/material-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/estaub/material-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/estaub/material-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/estaub/material-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/estaub/material-ui/contents/{+path}","compare_url":"https://api.github.com/repos/estaub/material-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/estaub/material-ui/merges","archive_url":"https://api.github.com/repos/estaub/material-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/estaub/material-ui/downloads","issues_url":"https://api.github.com/repos/estaub/material-ui/issues{/number}","pulls_url":"https://api.github.com/repos/estaub/material-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/estaub/material-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/estaub/material-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/estaub/material-ui/labels{/name}","releases_url":"https://api.github.com/repos/estaub/material-ui/releases{/id}","deployments_url":"https://api.github.com/repos/estaub/material-ui/deployments","created_at":"2018-04-12T13:15:45Z","updated_at":"2018-04-12T13:15:54Z","pushed_at":"2018-04-14T16:35:08Z","git_url":"git://github.com/estaub/material-ui.git","ssh_url":"git@github.com:estaub/material-ui.git","clone_url":"https://github.com/estaub/material-ui.git","svn_url":"https://github.com/estaub/material-ui","homepage":"http://www.material-ui.com","size":38106,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"v1-beta"}},"base":{"label":"mui-org:v1-beta","ref":"v1-beta","sha":"29cbe2c8c1fbb1ac7341ffd6e499a56f6030bf86","user":{"login":"mui-org","id":33663932,"avatar_url":"https://avatars2.githubusercontent.com/u/33663932?v=4","gravatar_id":"","url":"https://api.github.com/users/mui-org","html_url":"https://github.com/mui-org","followers_url":"https://api.github.com/users/mui-org/followers","following_url":"https://api.github.com/users/mui-org/following{/other_user}","gists_url":"https://api.github.com/users/mui-org/gists{/gist_id}","starred_url":"https://api.github.com/users/mui-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mui-org/subscriptions","organizations_url":"https://api.github.com/users/mui-org/orgs","repos_url":"https://api.github.com/users/mui-org/repos","events_url":"https://api.github.com/users/mui-org/events{/privacy}","received_events_url":"https://api.github.com/users/mui-org/received_events","type":"Organization","site_admin":false},"repo":{"id":23083156,"name":"material-ui","full_name":"mui-org/material-ui","owner":{"login":"mui-org","id":33663932,"avatar_url":"https://avatars2.githubusercontent.com/u/33663932?v=4","gravatar_id":"","url":"https://api.github.com/users/mui-org","html_url":"https://github.com/mui-org","followers_url":"https://api.github.com/users/mui-org/followers","following_url":"https://api.github.com/users/mui-org/following{/other_user}","gists_url":"https://api.github.com/users/mui-org/gists{/gist_id}","starred_url":"https://api.github.com/users/mui-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mui-org/subscriptions","organizations_url":"https://api.github.com/users/mui-org/orgs","repos_url":"https://api.github.com/users/mui-org/repos","events_url":"https://api.github.com/users/mui-org/events{/privacy}","received_events_url":"https://api.github.com/users/mui-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mui-org/material-ui","description":"React components that implement Google's Material Design.","fork":false,"url":"https://api.github.com/repos/mui-org/material-ui","forks_url":"https://api.github.com/repos/mui-org/material-ui/forks","keys_url":"https://api.github.com/repos/mui-org/material-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mui-org/material-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mui-org/material-ui/teams","hooks_url":"https://api.github.com/repos/mui-org/material-ui/hooks","issue_events_url":"https://api.github.com/repos/mui-org/material-ui/issues/events{/number}","events_url":"https://api.github.com/repos/mui-org/material-ui/events","assignees_url":"https://api.github.com/repos/mui-org/material-ui/assignees{/user}","branches_url":"https://api.github.com/repos/mui-org/material-ui/branches{/branch}","tags_url":"https://api.github.com/repos/mui-org/material-ui/tags","blobs_url":"https://api.github.com/repos/mui-org/material-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mui-org/material-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mui-org/material-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/mui-org/material-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mui-org/material-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/mui-org/material-ui/languages","stargazers_url":"https://api.github.com/repos/mui-org/material-ui/stargazers","contributors_url":"https://api.github.com/repos/mui-org/material-ui/contributors","subscribers_url":"https://api.github.com/repos/mui-org/material-ui/subscribers","subscription_url":"https://api.github.com/repos/mui-org/material-ui/subscription","commits_url":"https://api.github.com/repos/mui-org/material-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/mui-org/material-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/mui-org/material-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/mui-org/material-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/mui-org/material-ui/contents/{+path}","compare_url":"https://api.github.com/repos/mui-org/material-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mui-org/material-ui/merges","archive_url":"https://api.github.com/repos/mui-org/material-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mui-org/material-ui/downloads","issues_url":"https://api.github.com/repos/mui-org/material-ui/issues{/number}","pulls_url":"https://api.github.com/repos/mui-org/material-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/mui-org/material-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/mui-org/material-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mui-org/material-ui/labels{/name}","releases_url":"https://api.github.com/repos/mui-org/material-ui/releases{/id}","deployments_url":"https://api.github.com/repos/mui-org/material-ui/deployments","created_at":"2014-08-18T19:11:54Z","updated_at":"2018-04-14T17:42:26Z","pushed_at":"2018-04-14T16:57:02Z","git_url":"git://github.com/mui-org/material-ui.git","ssh_url":"git@github.com:mui-org/material-ui.git","clone_url":"https://github.com/mui-org/material-ui.git","svn_url":"https://github.com/mui-org/material-ui","homepage":"http://www.material-ui.com","size":38121,"stargazers_count":34932,"watchers_count":34932,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6407,"mirror_url":null,"archived":false,"open_issues_count":157,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":6407,"open_issues":157,"watchers":34932,"default_branch":"v1-beta"}},"_links":{"self":{"href":"https://api.github.com/repos/mui-org/material-ui/pulls/11003"},"html":{"href":"https://github.com/mui-org/material-ui/pull/11003"},"issue":{"href":"https://api.github.com/repos/mui-org/material-ui/issues/11003"},"comments":{"href":"https://api.github.com/repos/mui-org/material-ui/issues/11003/comments"},"review_comments":{"href":"https://api.github.com/repos/mui-org/material-ui/pulls/11003/comments"},"review_comment":{"href":"https://api.github.com/repos/mui-org/material-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mui-org/material-ui/pulls/11003/commits"},"statuses":{"href":"https://api.github.com/repos/mui-org/material-ui/statuses/175fa4944fc8f8e8bbc672e25a4a3ccc44000626"}},"author_association":"NONE"}}
{"actor":{"display_login":"pelotom"}}