{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30816","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30816/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30816/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30816/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30816","id":384133809,"node_id":"MDU6SXNzdWUzODQxMzM4MDk=","number":30816,"title":"[@types/react-redux] TS2345 in v6.0.10","user":{"login":"martinandert","id":6715978,"node_id":"MDQ6VXNlcjY3MTU5Nzg=","avatar_url":"https://avatars0.githubusercontent.com/u/6715978?v=4","gravatar_id":"","url":"https://api.github.com/users/martinandert","html_url":"https://github.com/martinandert","followers_url":"https://api.github.com/users/martinandert/followers","following_url":"https://api.github.com/users/martinandert/following{/other_user}","gists_url":"https://api.github.com/users/martinandert/gists{/gist_id}","starred_url":"https://api.github.com/users/martinandert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinandert/subscriptions","organizations_url":"https://api.github.com/users/martinandert/orgs","repos_url":"https://api.github.com/users/martinandert/repos","events_url":"https://api.github.com/users/martinandert/events{/privacy}","received_events_url":"https://api.github.com/users/martinandert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-11-26T00:01:31Z","updated_at":"2018-12-12T10:20:47Z","closed_at":null,"author_association":"NONE","body":"- [x] I tried using the `@types/react-redux` package and had problems.\r\n- [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript\r\n- [x] I have a question that is inappropriate for [StackOverflow](https://stackoverflow.com/).\r\n- [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see `Definitions by:` in `index.d.ts`) so they can respond.\r\n  - Authors: @surgeboris \r\n\r\nThe following (self-contained) component stopped working after upgrading @types/react-redux from v6.0.9 to v6.0.10:\r\n\r\n```tsx\r\nimport * as React from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { Dispatch } from \"redux\";\r\n\r\ninterface Item {\r\n  id: number;\r\n  content: string;\r\n}\r\n\r\ninterface RootState {\r\n  items: Item[];\r\n}\r\n\r\ninterface StateProps {\r\n  items: RootState[\"items\"];\r\n}\r\n\r\ninterface DispatchProps {\r\n  remove: (item: Item) => () => void;\r\n}\r\n\r\nfunction BaseItemList({ items, remove }: StateProps & DispatchProps) {\r\n  return (\r\n    <ol>\r\n      {items.map((item) => (\r\n        <li key={item.id}>\r\n          {item.content}\r\n\r\n          <button onClick={remove(item)}>\r\n            Remove\r\n          </button>\r\n        </li>\r\n      ))}\r\n    </ol>\r\n  );\r\n}\r\n\r\nconst mapStateToProps = ({ items }: RootState): StateProps => ({ items });\r\n\r\nconst mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({\r\n  remove: (item) => () => dispatch({ type: \"REMOVE_ITEM\", item }),\r\n});\r\n\r\nexport const ItemList = connect(mapStateToProps, mapDispatchToProps)(BaseItemList);\r\n```\r\n\r\nAfter the upgrade, the last line lets TS complain with error TS2345:\r\n\r\n```\r\nArgument of type '({ items, remove }: StateProps & DispatchProps) => Element' is not assignable to parameter of type 'ComponentType<Matching<StateProps & { remove: () => void; }, StateProps & DispatchProps>>'.\r\n  Type '({ items, remove }: StateProps & DispatchProps) => Element' is not assignable to type 'FunctionComponent<Matching<StateProps & { remove: () => void; }, StateProps & DispatchProps>>'.\r\n    Types of parameters '__0' and 'props' are incompatible.\r\n      Type 'Matching<StateProps & { remove: () => void; }, StateProps & DispatchProps> & { children?: ReactNode; }' is not assignable to type 'StateProps & DispatchProps'.\r\n        Type 'Matching<StateProps & { remove: () => void; }, StateProps & DispatchProps> & { children?: ReactNode; }' is not assignable to type 'DispatchProps'.\r\n          Types of property 'remove' are incompatible.\r\n            Type '() => void' is not assignable to type '(item: Item) => () => void'.\r\n              Type 'void' is not assignable to type '() => void'. [2345]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/446536293","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30816#issuecomment-446536293","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30816","id":446536293,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjUzNjI5Mw==","user":{"login":"surgeboris","id":21183294,"node_id":"MDQ6VXNlcjIxMTgzMjk0","avatar_url":"https://avatars3.githubusercontent.com/u/21183294?v=4","gravatar_id":"","url":"https://api.github.com/users/surgeboris","html_url":"https://github.com/surgeboris","followers_url":"https://api.github.com/users/surgeboris/followers","following_url":"https://api.github.com/users/surgeboris/following{/other_user}","gists_url":"https://api.github.com/users/surgeboris/gists{/gist_id}","starred_url":"https://api.github.com/users/surgeboris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surgeboris/subscriptions","organizations_url":"https://api.github.com/users/surgeboris/orgs","repos_url":"https://api.github.com/users/surgeboris/repos","events_url":"https://api.github.com/users/surgeboris/events{/privacy}","received_events_url":"https://api.github.com/users/surgeboris/received_events","type":"User","site_admin":false},"created_at":"2018-12-12T10:20:47Z","updated_at":"2018-12-12T10:20:47Z","author_association":"CONTRIBUTOR","body":"My fix was merged and I'm no longer able to reproduce the error for `@types/react-redux@6.0.11`.\r\n\r\n@martinandert can you close this issue?"}}
{"actor":{"display_login":"surgeboris"}}