Skip to content

Commit 4eb59a2

Browse files
authored
Fixing react defaultize+generic default props interaction (#27088)
* Add repro for fixed issue * Fix JSX propagating flags and contextual types * Accept slightly changed baselines * Add modern react.d.ts and regression test
1 parent bce34ad commit 4eb59a2

14 files changed

+3261
-16
lines changed

src/compiler/checker.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17361,12 +17361,14 @@ namespace ts {
1736117361
let hasSpreadAnyType = false;
1736217362
let typeToIntersect: Type | undefined;
1736317363
let explicitlySpecifyChildrenAttribute = false;
17364+
let propagatingFlags: TypeFlags = 0;
1736417365
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
1736517366

1736617367
for (const attributeDecl of attributes.properties) {
1736717368
const member = attributeDecl.symbol;
1736817369
if (isJsxAttribute(attributeDecl)) {
1736917370
const exprType = checkJsxAttribute(attributeDecl, checkMode);
17371+
propagatingFlags |= (exprType.flags & TypeFlags.PropagatingFlags);
1737017372

1737117373
const attributeSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.escapedName);
1737217374
attributeSymbol.declarations = member.declarations;
@@ -17384,15 +17386,15 @@ namespace ts {
1738417386
else {
1738517387
Debug.assert(attributeDecl.kind === SyntaxKind.JsxSpreadAttribute);
1738617388
if (attributesTable.size > 0) {
17387-
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, ObjectFlags.JsxAttributes);
17389+
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, propagatingFlags, ObjectFlags.JsxAttributes);
1738817390
attributesTable = createSymbolTable();
1738917391
}
1739017392
const exprType = checkExpressionCached(attributeDecl.expression, checkMode);
1739117393
if (isTypeAny(exprType)) {
1739217394
hasSpreadAnyType = true;
1739317395
}
1739417396
if (isValidSpreadType(exprType)) {
17395-
spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*typeFlags*/ 0, ObjectFlags.JsxAttributes);
17397+
spread = getSpreadType(spread, exprType, openingLikeElement.symbol, propagatingFlags, ObjectFlags.JsxAttributes);
1739617398
}
1739717399
else {
1739817400
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
@@ -17402,7 +17404,7 @@ namespace ts {
1740217404

1740317405
if (!hasSpreadAnyType) {
1740417406
if (attributesTable.size > 0) {
17405-
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, ObjectFlags.JsxAttributes);
17407+
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, propagatingFlags, ObjectFlags.JsxAttributes);
1740617408
}
1740717409
}
1740817410

@@ -17428,7 +17430,7 @@ namespace ts {
1742817430
const childPropMap = createSymbolTable();
1742917431
childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol);
1743017432
spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined),
17431-
attributes.symbol, /*typeFlags*/ 0, ObjectFlags.JsxAttributes);
17433+
attributes.symbol, propagatingFlags, ObjectFlags.JsxAttributes);
1743217434

1743317435
}
1743417436
}
@@ -17448,7 +17450,7 @@ namespace ts {
1744817450
*/
1744917451
function createJsxAttributesType() {
1745017452
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
17451-
result.flags |= TypeFlags.ContainsObjectLiteral;
17453+
result.flags |= (propagatingFlags |= TypeFlags.ContainsObjectLiteral);
1745217454
result.objectFlags |= ObjectFlags.ObjectLiteral | ObjectFlags.JsxAttributes;
1745317455
return result;
1745417456
}
@@ -21957,7 +21959,7 @@ namespace ts {
2195721959
}
2195821960

2195921961
function getContextNode(node: Expression): Node {
21960-
if (node.kind === SyntaxKind.JsxAttributes) {
21962+
if (node.kind === SyntaxKind.JsxAttributes && !isJsxSelfClosingElement(node.parent)) {
2196121963
return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes)
2196221964
}
2196321965
return node;

tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
tests/cases/conformance/jsx/file.tsx(13,54): error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'.
2-
Type 'string' is not assignable to type '{ x: string; }'.
1+
tests/cases/conformance/jsx/file.tsx(13,54): error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '((a: { x: string; }) => string) & ((cur: { x: string; }) => { x: string; })'.
2+
Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'.
3+
Type 'string' is not assignable to type '{ x: string; }'.
34

45

56
==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
@@ -17,6 +18,7 @@ tests/cases/conformance/jsx/file.tsx(13,54): error TS2322: Type '(a: { x: string
1718
let c = <GenericComponent initialValues={{ x: "y" }} nextValues={a => ({ x: a.x })} />; // No Error
1819
let d = <GenericComponent initialValues={{ x: "y" }} nextValues={a => a.x} />; // Error - `string` is not assignable to `{x: string}`
1920
~~~~~~~~~~
20-
!!! error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'.
21-
!!! error TS2322: Type 'string' is not assignable to type '{ x: string; }'.
22-
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:13:54: The expected type comes from property 'nextValues' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<GenericComponent<{ initialValues: { x: string; }; nextValues: {}; }, { x: string; }>> & { initialValues: { x: string; }; nextValues: {}; } & BaseProps<{ x: string; }> & { children?: ReactNode; }'
21+
!!! error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '((a: { x: string; }) => string) & ((cur: { x: string; }) => { x: string; })'.
22+
!!! error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'.
23+
!!! error TS2322: Type 'string' is not assignable to type '{ x: string; }'.
24+
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:13:54: The expected type comes from property 'nextValues' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<GenericComponent<{ initialValues: { x: string; }; nextValues: (a: { x: string; }) => string; }, { x: string; }>> & { initialValues: { x: string; }; nextValues: (a: { x: string; }) => string; } & BaseProps<{ x: string; }> & { children?: ReactNode; }'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//// [conditionalTypeContextualTypeSimplificationsSuceeds.ts]
2+
// repro from https://github.com/Microsoft/TypeScript/issues/26395
3+
interface Props {
4+
when: (value: string) => boolean;
5+
}
6+
7+
function bad<P extends Props>(
8+
attrs: string extends keyof P ? { [K in keyof P]: P[K] } : { [K in keyof P]: P[K] }) { }
9+
function good1<P extends Props>(
10+
attrs: string extends keyof P ? P : { [K in keyof P]: P[K] }) { }
11+
function good2<P extends Props>(
12+
attrs: { [K in keyof P]: P[K] }) { }
13+
14+
bad({ when: value => false });
15+
good1({ when: value => false });
16+
good2({ when: value => false });
17+
18+
//// [conditionalTypeContextualTypeSimplificationsSuceeds.js]
19+
"use strict";
20+
function bad(attrs) { }
21+
function good1(attrs) { }
22+
function good2(attrs) { }
23+
bad({ when: function (value) { return false; } });
24+
good1({ when: function (value) { return false; } });
25+
good2({ when: function (value) { return false; } });
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
=== tests/cases/compiler/conditionalTypeContextualTypeSimplificationsSuceeds.ts ===
2+
// repro from https://github.com/Microsoft/TypeScript/issues/26395
3+
interface Props {
4+
>Props : Symbol(Props, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 0, 0))
5+
6+
when: (value: string) => boolean;
7+
>when : Symbol(Props.when, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 1, 17))
8+
>value : Symbol(value, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 2, 11))
9+
}
10+
11+
function bad<P extends Props>(
12+
>bad : Symbol(bad, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 3, 1))
13+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 5, 13))
14+
>Props : Symbol(Props, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 0, 0))
15+
16+
attrs: string extends keyof P ? { [K in keyof P]: P[K] } : { [K in keyof P]: P[K] }) { }
17+
>attrs : Symbol(attrs, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 5, 30))
18+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 5, 13))
19+
>K : Symbol(K, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 6, 39))
20+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 5, 13))
21+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 5, 13))
22+
>K : Symbol(K, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 6, 39))
23+
>K : Symbol(K, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 6, 66))
24+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 5, 13))
25+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 5, 13))
26+
>K : Symbol(K, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 6, 66))
27+
28+
function good1<P extends Props>(
29+
>good1 : Symbol(good1, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 6, 92))
30+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 7, 15))
31+
>Props : Symbol(Props, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 0, 0))
32+
33+
attrs: string extends keyof P ? P : { [K in keyof P]: P[K] }) { }
34+
>attrs : Symbol(attrs, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 7, 32))
35+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 7, 15))
36+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 7, 15))
37+
>K : Symbol(K, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 8, 43))
38+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 7, 15))
39+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 7, 15))
40+
>K : Symbol(K, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 8, 43))
41+
42+
function good2<P extends Props>(
43+
>good2 : Symbol(good2, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 8, 69))
44+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 9, 15))
45+
>Props : Symbol(Props, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 0, 0))
46+
47+
attrs: { [K in keyof P]: P[K] }) { }
48+
>attrs : Symbol(attrs, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 9, 32))
49+
>K : Symbol(K, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 10, 14))
50+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 9, 15))
51+
>P : Symbol(P, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 9, 15))
52+
>K : Symbol(K, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 10, 14))
53+
54+
bad({ when: value => false });
55+
>bad : Symbol(bad, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 3, 1))
56+
>when : Symbol(when, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 12, 5))
57+
>value : Symbol(value, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 12, 11))
58+
59+
good1({ when: value => false });
60+
>good1 : Symbol(good1, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 6, 92))
61+
>when : Symbol(when, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 13, 7))
62+
>value : Symbol(value, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 13, 13))
63+
64+
good2({ when: value => false });
65+
>good2 : Symbol(good2, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 8, 69))
66+
>when : Symbol(when, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 14, 7))
67+
>value : Symbol(value, Decl(conditionalTypeContextualTypeSimplificationsSuceeds.ts, 14, 13))
68+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
=== tests/cases/compiler/conditionalTypeContextualTypeSimplificationsSuceeds.ts ===
2+
// repro from https://github.com/Microsoft/TypeScript/issues/26395
3+
interface Props {
4+
when: (value: string) => boolean;
5+
>when : (value: string) => boolean
6+
>value : string
7+
}
8+
9+
function bad<P extends Props>(
10+
>bad : <P extends Props>(attrs: string extends keyof P ? { [K in keyof P]: P[K]; } : { [K in keyof P]: P[K]; }) => void
11+
12+
attrs: string extends keyof P ? { [K in keyof P]: P[K] } : { [K in keyof P]: P[K] }) { }
13+
>attrs : string extends keyof P ? { [K in keyof P]: P[K]; } : { [K in keyof P]: P[K]; }
14+
15+
function good1<P extends Props>(
16+
>good1 : <P extends Props>(attrs: string extends keyof P ? P : { [K in keyof P]: P[K]; }) => void
17+
18+
attrs: string extends keyof P ? P : { [K in keyof P]: P[K] }) { }
19+
>attrs : string extends keyof P ? P : { [K in keyof P]: P[K]; }
20+
21+
function good2<P extends Props>(
22+
>good2 : <P extends Props>(attrs: { [K in keyof P]: P[K]; }) => void
23+
24+
attrs: { [K in keyof P]: P[K] }) { }
25+
>attrs : { [K in keyof P]: P[K]; }
26+
27+
bad({ when: value => false });
28+
>bad({ when: value => false }) : void
29+
>bad : <P extends Props>(attrs: string extends keyof P ? { [K in keyof P]: P[K]; } : { [K in keyof P]: P[K]; }) => void
30+
>{ when: value => false } : { when: (value: string) => false; }
31+
>when : (value: string) => false
32+
>value => false : (value: string) => false
33+
>value : string
34+
>false : false
35+
36+
good1({ when: value => false });
37+
>good1({ when: value => false }) : void
38+
>good1 : <P extends Props>(attrs: string extends keyof P ? P : { [K in keyof P]: P[K]; }) => void
39+
>{ when: value => false } : { when: (value: string) => false; }
40+
>when : (value: string) => false
41+
>value => false : (value: string) => false
42+
>value : string
43+
>false : false
44+
45+
good2({ when: value => false });
46+
>good2({ when: value => false }) : void
47+
>good2 : <P extends Props>(attrs: { [K in keyof P]: P[K]; }) => void
48+
>{ when: value => false } : { when: (value: string) => false; }
49+
>when : (value: string) => false
50+
>value => false : (value: string) => false
51+
>value : string
52+
>false : false
53+

tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(20,31): error TS2322: Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'.
1+
tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(20,31): error TS2322: Type '(p: LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'.
22
Type '"y"' is not assignable to type '"x"'.
33
tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(21,19): error TS2322: Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'.
44
Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x" | "y">'.
@@ -39,7 +39,7 @@ tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(22,21): error TS2322:
3939
// Should error
4040
const arg = <ElemLit prop="x" children={p => "y"} />
4141
~~~~~~~~
42-
!!! error TS2322: Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'.
42+
!!! error TS2322: Type '(p: LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'.
4343
!!! error TS2322: Type '"y"' is not assignable to type '"x"'.
4444
!!! related TS6500 tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx:13:34: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & LitProps<"x">'
4545
const argchild = <ElemLit prop="x">{p => "y"}</ElemLit>

tests/baselines/reference/jsxChildrenGenericContextualTypes.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ const arg = <ElemLit prop="x" children={p => "y"} />
117117
><ElemLit prop="x" children={p => "y"} /> : JSX.Element
118118
>ElemLit : <T extends string>(p: LitProps<T>) => JSX.Element
119119
>prop : "x"
120-
>children : (p: JSX.IntrinsicAttributes & LitProps<"x">) => "y"
121-
>p => "y" : (p: JSX.IntrinsicAttributes & LitProps<"x">) => "y"
122-
>p : JSX.IntrinsicAttributes & LitProps<"x">
120+
>children : (p: LitProps<"x">) => "y"
121+
>p => "y" : (p: LitProps<"x">) => "y"
122+
>p : LitProps<"x">
123123
>"y" : "y"
124124

125125
const argchild = <ElemLit prop="x">{p => "y"}</ElemLit>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(26,36): error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
2+
Type 'void' is not assignable to type 'boolean'.
3+
tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(48,37): error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
4+
Type 'void' is not assignable to type 'boolean'.
5+
6+
7+
==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (2 errors) ====
8+
/// <reference path="/.lib/react16.d.ts" />
9+
10+
import React from 'react';
11+
12+
interface BaseProps {
13+
when?: (value: string) => boolean;
14+
}
15+
16+
interface Props extends BaseProps {
17+
}
18+
19+
class FieldFeedback<P extends Props = BaseProps> extends React.Component<P> {
20+
static defaultProps = {
21+
when: () => true
22+
};
23+
24+
render() {
25+
return <div>Hello</div>;
26+
}
27+
}
28+
29+
// OK
30+
const Test1 = () => <FieldFeedback when={value => !!value} />;
31+
32+
// Error: Void not assignable to boolean
33+
const Test2 = () => <FieldFeedback when={value => console.log(value)} />;
34+
~~~~
35+
!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
36+
!!! error TS2322: Type 'void' is not assignable to type 'boolean'.
37+
!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<FieldFeedback<Props>> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, "children"> & Partial<Pick<Readonly<{ children?: ReactNode; }> & Readonly<Props>, "when">> & Partial<Pick<{ when: () => boolean; }, never>>'
38+
39+
40+
interface MyPropsProps extends Props {
41+
when: (value: string) => boolean;
42+
}
43+
44+
class FieldFeedback2<P extends MyPropsProps = MyPropsProps> extends FieldFeedback<P> {
45+
static defaultProps = {
46+
when: () => true
47+
};
48+
49+
render() {
50+
this.props.when("now"); // OK, always defined
51+
return <div>Hello</div>;
52+
}
53+
}
54+
55+
// OK
56+
const Test3 = () => <FieldFeedback2 when={value => !!value} />;
57+
58+
// Error: Void not assignable to boolean
59+
const Test4 = () => <FieldFeedback2 when={value => console.log(value)} />;
60+
~~~~
61+
!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'.
62+
!!! error TS2322: Type 'void' is not assignable to type 'boolean'.
63+
!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:30:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<FieldFeedback2<MyPropsProps>> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<MyPropsProps>, "children"> & Partial<Pick<Readonly<{ children?: ReactNode; }> & Readonly<MyPropsProps>, "when">> & Partial<Pick<{ when: () => boolean; }, never>>'
64+
65+
// OK
66+
const Test5 = () => <FieldFeedback2 />;
67+

0 commit comments

Comments
 (0)