{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/36066","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/36066/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/36066/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/36066/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/36066","id":453928028,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjg2NDkwNzI5","number":36066,"title":"[@types/react] New component types - typing props and state as DeepReadonly","user":{"login":"carpben","id":13496178,"node_id":"MDQ6VXNlcjEzNDk2MTc4","avatar_url":"https://avatars1.githubusercontent.com/u/13496178?v=4","gravatar_id":"","url":"https://api.github.com/users/carpben","html_url":"https://github.com/carpben","followers_url":"https://api.github.com/users/carpben/followers","following_url":"https://api.github.com/users/carpben/following{/other_user}","gists_url":"https://api.github.com/users/carpben/gists{/gist_id}","starred_url":"https://api.github.com/users/carpben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carpben/subscriptions","organizations_url":"https://api.github.com/users/carpben/orgs","repos_url":"https://api.github.com/users/carpben/repos","events_url":"https://api.github.com/users/carpben/events{/privacy}","received_events_url":"https://api.github.com/users/carpben/received_events","type":"User","site_admin":false},"labels":[{"id":684321576,"node_id":"MDU6TGFiZWw2ODQzMjE1NzY=","url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/Popular%20package","name":"Popular package","color":"fbca04","default":false},{"id":57534397,"node_id":"MDU6TGFiZWw1NzUzNDM5Nw==","url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/The%20Travis%20CI%20build%20failed","name":"The Travis CI build failed","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2019-06-09T19:01:56Z","updated_at":"2019-06-11T05:25:26Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/36066","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/36066","diff_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/36066.diff","patch_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/36066.patch"},"body":"Please fill in this template.\r\n\r\n- [x ] Use a meaningful title for the pull request. Include the name of the package modified.\r\n- [x ] Test the change in your own code. (Compile and run.)\r\n- [ ] Add or edit tests to reflect the change. (Run with `npm test`.)\r\n- [x ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).\r\n- [x ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).\r\n- [x ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).\r\n\r\nSelect one of these and delete the others:\r\n\r\nIf changing an existing definition:\r\n- [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <<https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts>>\r\n- [ ] Increase the version number in the header if appropriate.\r\n- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ \"extends\": \"dtslint/dt.json\" }`.\r\n\r\nIf removing a declaration:\r\n- [ ] If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)\r\n- [ ] Delete the package's directory.\r\n- [ ] Add it to `notNeededPackages.json`.\r\n\r\n\r\nFollowing[ feature suggestion 31914](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31914).\r\nCurrently this commit adds:\r\n1. a new functional component type DRFC which types props as DeepReadonly.\r\n2. A new DRPureComponent which extends the class component. I think that wrapping state and props in DeepReadonly goes along with using a pure component. Using immutable data guarantees that if a reference hasn't changed, none of its properties and deep properties have changed.\r\n```ts\r\nclass DRPureComponent<P = {}, S = {}, SS = any> extends React.PureComponent<DR<P>, DR<S>, SS> { }\r\n```\r\n3. An adjustment to `JSXElementConstructor` to handle the new component types. \r\n\r\nIt's important to note that if we would type state or props as `DeepReadonly` on an existing component type, this would be a breaking change, since you can't pass a `ReadonlyArray` to a function that expects an oridnary `Array` (which lacks methods such as `.push`). Therefor it is necessary to offer a new type, and not to replace a current one."},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/500691604","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/36066#issuecomment-500691604","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/36066","id":500691604,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMDY5MTYwNA==","user":{"login":"typescript-bot","id":23042052,"node_id":"MDQ6VXNlcjIzMDQyMDUy","avatar_url":"https://avatars0.githubusercontent.com/u/23042052?v=4","gravatar_id":"","url":"https://api.github.com/users/typescript-bot","html_url":"https://github.com/typescript-bot","followers_url":"https://api.github.com/users/typescript-bot/followers","following_url":"https://api.github.com/users/typescript-bot/following{/other_user}","gists_url":"https://api.github.com/users/typescript-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/typescript-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typescript-bot/subscriptions","organizations_url":"https://api.github.com/users/typescript-bot/orgs","repos_url":"https://api.github.com/users/typescript-bot/repos","events_url":"https://api.github.com/users/typescript-bot/events{/privacy}","received_events_url":"https://api.github.com/users/typescript-bot/received_events","type":"User","site_admin":false},"created_at":"2019-06-11T05:25:26Z","updated_at":"2019-06-11T05:25:26Z","author_association":"CONTRIBUTOR","body":"<!--header {\"slug\":\"complaint-1560225409000\"} headerend-->\r\n@carpben The Travis CI build failed! Please [review the logs for more information](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/544033127?utm_source=github_status&utm_medium=notification).\r\n\r\nOnce you've pushed the fixes, the build will automatically re-run. Thanks!\r\n<!--footer bot @ 6/10/2019, 10:25:26 PM footerend-->"}}
{"actor":{"display_login":"typescript-bot"}}