mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
Add integration test for <JSX key="foo" {...spread} onClick={() => {}} />
This commit is contained in:
@@ -117,6 +117,7 @@ async function main() {
|
||||
"/array-args-with-default-values.js",
|
||||
"/forbid-in-is-correct.js",
|
||||
"/code-simplification-neql-define.js",
|
||||
"/spread_with_key.tsx",
|
||||
];
|
||||
tests.reverse();
|
||||
|
||||
|
||||
20
integration/snippets/spread_with_key.tsx
Normal file
20
integration/snippets/spread_with_key.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import React from "react";
|
||||
|
||||
export function SpreadWithTheKey({ className }: Props) {
|
||||
const rest = {};
|
||||
return (
|
||||
<div
|
||||
className={className}
|
||||
key="spread-with-the-key"
|
||||
{...rest}
|
||||
onClick={() => console.log("click")}
|
||||
>
|
||||
Rendered component containing warning
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function test() {
|
||||
console.assert(React.isValidElement(<SpreadWithTheKey className="foo" />));
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
Reference in New Issue
Block a user