Consistently ignore attributes with hyphenated names in JSX (#44873)

* Consistently skip attributes with hyphenated names in JSX

* Add regression test

* Accept new baselines

* Fix tests

* Accept new baselines
This commit is contained in:
Anders Hejlsberg
2021-07-06 13:29:51 -07:00
committed by GitHub
parent 1da18c60d6
commit 8e01a86c01
10 changed files with 227 additions and 24 deletions

View File

@@ -0,0 +1,22 @@
// @strict: true
// @jsx: react
/// <reference path="/.lib/react16.d.ts" />
// Repro from #44797
import * as React from "react";
interface Props {
foo: string;
[dataProp: string]: string;
}
declare function Yadda(props: Props): JSX.Element;
let props: Props = {
foo: "",
"data-yadda": 42, // Error
};
let x1 = <Yadda foo="hello" data-yadda={42}/>;
let x2 = <Yadda bar="hello" data-yadda={42}/>; // Error