Files
tsgo/testdata/baselines/reference/submodule/conformance/tsxAttributeResolution4.js

27 lines
498 B
TypeScript

//// [tests/cases/conformance/jsx/tsxAttributeResolution4.tsx] ////
//// [file.tsx]
declare namespace JSX {
interface Element { }
interface IntrinsicElements {
test1: Attribs1;
}
}
interface Attribs1 {
x(n: string): void;
}
// OK
<test1 {... {x: (n) => 0} } />;
// Error, no member 'len' on 'string'
<test1 {... {x: (n) => n.len} } />;
//// [file.jsx]
"use strict";
// OK
<test1 {...{ x: (n) => 0 }}/>;
// Error, no member 'len' on 'string'
<test1 {...{ x: (n) => n.len }}/>;