Title: Higher order type inference from generic React component · Issue #30650 · microsoft/TypeScript · GitHub
Open Graph Title: Higher order type inference from generic React component · Issue #30650 · microsoft/TypeScript
X Title: Higher order type inference from generic React component · Issue #30650 · microsoft/TypeScript
Description: TypeScript Version: 3.4.1 Search Terms: Code interface Component
{ (props: P): unknown; // Comment this out and it works defaultProps?: Partial
; } declare function myHoc Open Graph Description: TypeScript Version: 3.4.1 Search Terms: Code interface Component { (props: P): unknown; // Comment this out and it works defaultProps?: Partial ; } declare function myHoc X Description: TypeScript Version: 3.4.1 Search Terms: Code interface Component<P> { (props: P): unknown; // Comment this out and it works defaultProps?: Partial<P>; } declare function myHoc<Props&...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/30650
X: @github
Domain: github.com
{ (props: P): unknown; // Comment this out and it works defaultProps?: Partial ; } declare function myHoc Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Higher order type inference from generic React component","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n--\u003e\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --\u003e\r\n**TypeScript Version:** 3.4.1\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) --\u003e\r\n**Search Terms:**\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface Component\u003cP\u003e {\r\n (props: P): unknown;\r\n // Comment this out and it works\r\n defaultProps?: Partial\u003cP\u003e;\r\n}\r\ndeclare function myHoc\u003cProps\u003e(C: Component\u003cProps\u003e): Component\u003cProps\u003e;\r\n\r\ntype Props\u003cT\u003e = { t: T; foo: number };\r\ndeclare function MyComponent\u003cT\u003e(props: Props\u003cT\u003e): unknown;\r\n// Expected type: \u003cT\u003e(props: Props\u003cT\u003e) =\u003e unknown\r\n// Actual type: Component\u003cProps\u003c{}\u003e\u003e\r\nconst MyComponent2 = myHoc(MyComponent);\r\n\r\n// Workaround: assert the resulting type\r\nconst MyComponent3 = myHoc(MyComponent) as typeof MyComponent;\r\n```","author":{"url":"https://github.com/OliverJAsh","@type":"Person","name":"OliverJAsh"},"datePublished":"2019-03-29T21:23:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/30650/TypeScript/issues/30650"}
route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:18de873f-c06f-2fd7-2660-5a3cd0fd0b2b current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 8A32:DF85B:D02FE4:12149B5:6A625591 html-safe-nonce 209103881cb924c7225bfcd5fd6fa9c0d6273e2199e9d748c2bfeffebe0dc990 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTMyOkRGODVCOkQwMkZFNDoxMjE0OUI1OjZBNjI1NTkxIiwidmlzaXRvcl9pZCI6IjkwNzU5MDg0NTU0MDUwODIwMDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac 1491619daaa5be301a2d8ab583940da58b106cfcd7ed083f561e1c8d8404dcec hovercard-subject-tag issue:427183279 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/30650/issue_layout twitter:image https://opengraph.githubassets.com/a3c0416190d0b5d80788f2e5bd975d7d159946f57628fe5ff49540980899a6dc/microsoft/TypeScript/issues/30650 twitter:card summary_large_image og:image https://opengraph.githubassets.com/a3c0416190d0b5d80788f2e5bd975d7d159946f57628fe5ff49540980899a6dc/microsoft/TypeScript/issues/30650 og:image:alt TypeScript Version: 3.4.1 Search Terms: Code interface Component og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username OliverJAsh hostname github.com expected-hostname github.com None b928dd27bb9305f313c737471c216297e218430ec505d064cf33d7d74af9bf89 turbo-cache-control no-preview go-import github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git octolytics-dimension-user_id 6154722 octolytics-dimension-user_login microsoft octolytics-dimension-repository_id 20929025 octolytics-dimension-repository_nwo microsoft/TypeScript octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 20929025 octolytics-dimension-repository_network_root_nwo microsoft/TypeScript turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 6f728c3f39985ee4d171ffdd5591d8d2652392d9 ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.