-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Pick PR #38577 (Include unknown in spread prop over...) into releas…
…e-3.9 (#38581) * Cherry-pick PR #38577 into release-3.9 Component commits: e5bccaf Include unknown in spread prop override check * Empty commit Co-authored-by: Wesley Wigham <[email protected]> Co-authored-by: Wesley Wigham <[email protected]>
- Loading branch information
1 parent
e354d47
commit 8037e26
Showing
5 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//// [jsxPartialSpread.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
const Select = (p: {value?: unknown}) => <p></p>; | ||
import React from 'react'; | ||
|
||
export function Repro({ SelectProps = {} }: { SelectProps?: Partial<Parameters<typeof Select>[0]> }) { | ||
return ( | ||
<Select value={'test'} {...SelectProps} /> | ||
); | ||
} | ||
|
||
//// [jsxPartialSpread.jsx] | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
exports.__esModule = true; | ||
exports.Repro = void 0; | ||
/// <reference path="react16.d.ts" /> | ||
var Select = function (p) { return <p></p>; }; | ||
var react_1 = __importDefault(require("react")); | ||
function Repro(_a) { | ||
var _b = _a.SelectProps, SelectProps = _b === void 0 ? {} : _b; | ||
return (<Select value={'test'} {...SelectProps}/>); | ||
} | ||
exports.Repro = Repro; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
=== tests/cases/compiler/jsxPartialSpread.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
const Select = (p: {value?: unknown}) => <p></p>; | ||
>Select : Symbol(Select, Decl(jsxPartialSpread.tsx, 1, 5)) | ||
>p : Symbol(p, Decl(jsxPartialSpread.tsx, 1, 16)) | ||
>value : Symbol(value, Decl(jsxPartialSpread.tsx, 1, 20)) | ||
>p : Symbol(JSX.IntrinsicElements.p, Decl(react16.d.ts, 2467, 102)) | ||
>p : Symbol(JSX.IntrinsicElements.p, Decl(react16.d.ts, 2467, 102)) | ||
|
||
import React from 'react'; | ||
>React : Symbol(React, Decl(jsxPartialSpread.tsx, 2, 6)) | ||
|
||
export function Repro({ SelectProps = {} }: { SelectProps?: Partial<Parameters<typeof Select>[0]> }) { | ||
>Repro : Symbol(Repro, Decl(jsxPartialSpread.tsx, 2, 26)) | ||
>SelectProps : Symbol(SelectProps, Decl(jsxPartialSpread.tsx, 4, 23)) | ||
>SelectProps : Symbol(SelectProps, Decl(jsxPartialSpread.tsx, 4, 45)) | ||
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) | ||
>Parameters : Symbol(Parameters, Decl(lib.es5.d.ts, --, --)) | ||
>Select : Symbol(Select, Decl(jsxPartialSpread.tsx, 1, 5)) | ||
|
||
return ( | ||
<Select value={'test'} {...SelectProps} /> | ||
>Select : Symbol(Select, Decl(jsxPartialSpread.tsx, 1, 5)) | ||
>value : Symbol(value, Decl(jsxPartialSpread.tsx, 6, 15)) | ||
>SelectProps : Symbol(SelectProps, Decl(jsxPartialSpread.tsx, 4, 23)) | ||
|
||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
=== tests/cases/compiler/jsxPartialSpread.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
const Select = (p: {value?: unknown}) => <p></p>; | ||
>Select : (p: { value?: unknown;}) => JSX.Element | ||
>(p: {value?: unknown}) => <p></p> : (p: { value?: unknown;}) => JSX.Element | ||
>p : { value?: unknown; } | ||
>value : unknown | ||
><p></p> : JSX.Element | ||
>p : { value?: unknown; } | ||
>p : { value?: unknown; } | ||
|
||
import React from 'react'; | ||
>React : typeof React | ||
|
||
export function Repro({ SelectProps = {} }: { SelectProps?: Partial<Parameters<typeof Select>[0]> }) { | ||
>Repro : ({ SelectProps }: { SelectProps?: Partial<Parameters<typeof Select>[0]>;}) => JSX.Element | ||
>SelectProps : Partial<{ value?: unknown; }> | ||
>{} : {} | ||
>SelectProps : Partial<{ value?: unknown; }> | undefined | ||
>Select : (p: { value?: unknown; }) => JSX.Element | ||
|
||
return ( | ||
>( <Select value={'test'} {...SelectProps} /> ) : JSX.Element | ||
|
||
<Select value={'test'} {...SelectProps} /> | ||
><Select value={'test'} {...SelectProps} /> : JSX.Element | ||
>Select : (p: { value?: unknown; }) => JSX.Element | ||
>value : string | ||
>'test' : "test" | ||
>SelectProps : Partial<{ value?: unknown; }> | ||
|
||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// @jsx: preserve | ||
// @esModuleInterop: true | ||
// @strict: true | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
const Select = (p: {value?: unknown}) => <p></p>; | ||
import React from 'react'; | ||
|
||
export function Repro({ SelectProps = {} }: { SelectProps?: Partial<Parameters<typeof Select>[0]> }) { | ||
return ( | ||
<Select value={'test'} {...SelectProps} /> | ||
); | ||
} |