|
| 1 | +=== tests/cases/compiler/ignoredJsxAttributes.tsx === |
| 2 | +/// <reference path="react16.d.ts" /> |
| 3 | + |
| 4 | +// Repro from #44797 |
| 5 | + |
| 6 | +import * as React from "react"; |
| 7 | +>React : Symbol(React, Decl(ignoredJsxAttributes.tsx, 4, 6)) |
| 8 | + |
| 9 | +interface Props { |
| 10 | +>Props : Symbol(Props, Decl(ignoredJsxAttributes.tsx, 4, 31)) |
| 11 | + |
| 12 | + foo: string; |
| 13 | +>foo : Symbol(Props.foo, Decl(ignoredJsxAttributes.tsx, 6, 17)) |
| 14 | + |
| 15 | + [dataProp: string]: string; |
| 16 | +>dataProp : Symbol(dataProp, Decl(ignoredJsxAttributes.tsx, 8, 5)) |
| 17 | +} |
| 18 | + |
| 19 | +declare function Yadda(props: Props): JSX.Element; |
| 20 | +>Yadda : Symbol(Yadda, Decl(ignoredJsxAttributes.tsx, 9, 1)) |
| 21 | +>props : Symbol(props, Decl(ignoredJsxAttributes.tsx, 11, 23)) |
| 22 | +>Props : Symbol(Props, Decl(ignoredJsxAttributes.tsx, 4, 31)) |
| 23 | +>JSX : Symbol(JSX, Decl(react16.d.ts, 2493, 12)) |
| 24 | +>Element : Symbol(JSX.Element, Decl(react16.d.ts, 2494, 23)) |
| 25 | + |
| 26 | +let props: Props = { |
| 27 | +>props : Symbol(props, Decl(ignoredJsxAttributes.tsx, 13, 3)) |
| 28 | +>Props : Symbol(Props, Decl(ignoredJsxAttributes.tsx, 4, 31)) |
| 29 | + |
| 30 | + foo: "", |
| 31 | +>foo : Symbol(foo, Decl(ignoredJsxAttributes.tsx, 13, 20)) |
| 32 | + |
| 33 | + "data-yadda": 42, // Error |
| 34 | +>"data-yadda" : Symbol("data-yadda", Decl(ignoredJsxAttributes.tsx, 14, 12)) |
| 35 | + |
| 36 | +}; |
| 37 | + |
| 38 | +let x1 = <Yadda foo="hello" data-yadda={42}/>; |
| 39 | +>x1 : Symbol(x1, Decl(ignoredJsxAttributes.tsx, 18, 3)) |
| 40 | +>Yadda : Symbol(Yadda, Decl(ignoredJsxAttributes.tsx, 9, 1)) |
| 41 | +>foo : Symbol(foo, Decl(ignoredJsxAttributes.tsx, 18, 15)) |
| 42 | +>data-yadda : Symbol(data-yadda, Decl(ignoredJsxAttributes.tsx, 18, 27)) |
| 43 | + |
| 44 | +let x2 = <Yadda bar="hello" data-yadda={42}/>; // Error |
| 45 | +>x2 : Symbol(x2, Decl(ignoredJsxAttributes.tsx, 19, 3)) |
| 46 | +>Yadda : Symbol(Yadda, Decl(ignoredJsxAttributes.tsx, 9, 1)) |
| 47 | +>bar : Symbol(bar, Decl(ignoredJsxAttributes.tsx, 19, 15)) |
| 48 | +>data-yadda : Symbol(data-yadda, Decl(ignoredJsxAttributes.tsx, 19, 27)) |
| 49 | + |
0 commit comments