[react] Add support for legacy context in JSXElementConstructor #65566
Conversation
This matches how we type `FunctionComponent` today. We need support for legacy context in `JSX.ElementType` anyway and `React.JSXElementConstructor` is the designated type for `JSX.ElementType`
|
Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files. react (unpkg)was missing the following properties:
|
|
@eps1lon Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 65566,
"author": "eps1lon",
"headCommitOid": "438312001b593580679db550e0eb48fb860c8e6e",
"mergeBaseOid": "1c53adb42babc2cc331e3198135c2dc09f9508e5",
"lastPushDate": "2023-05-22T19:06:21.000Z",
"lastActivityDate": "2023-05-22T19:32:20.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "react",
"kind": "edit",
"files": [
{
"path": "types/react/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/test/index.ts",
"kind": "test"
},
{
"path": "types/react/test/tsx.tsx",
"kind": "test"
},
{
"path": "types/react/ts5.0/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/ts5.0/test/index.ts",
"kind": "test"
},
{
"path": "types/react/ts5.0/test/tsx.tsx",
"kind": "test"
}
],
"owners": [
"johnnyreilly",
"bbenezech",
"pzavolinsky",
"ericanderson",
"DovydasNavickas",
"theruther4d",
"guilhermehubner",
"ferdaber",
"jrakotoharisoa",
"pascaloliv",
"hotell",
"franklixuefei",
"Jessidhia",
"saranshkataria",
"lukyth",
"eps1lon",
"zieka",
"dancerphil",
"dimitropoulos",
"disjukr",
"vhfmag",
"hellatan",
"priyanshurav",
"Semigradsky"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [],
"mainBotCommentID": 1557829084,
"ciResult": "pass"
} |
|
🔔 @johnnyreilly @bbenezech @pzavolinsky @ericanderson @DovydasNavickas @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @zieka @dancerphil @dimitropoulos @disjukr @vhfmag @hellatan @priyanshurav @Semigradsky — please review this PR in the next few days. Be sure to explicitly select |
|
Integrates cleanly and works fine on internal repos. Merging to unblock #65135 |
This matches how we type
FunctionComponenttoday.We need support for legacy context in
JSX.ElementTypeanyway (see #65135 (comment))and
React.JSXElementConstructoris the designated type for `JSX.ElementType