mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
test(es/parser): Add a test for a fixed issue (#4388)
This commit is contained in:
parent
a4c708858e
commit
b9cba1ad4d
@ -0,0 +1,14 @@
|
||||
{
|
||||
"jsc": {
|
||||
"transform": {
|
||||
"hidden": {
|
||||
"jest": true
|
||||
}
|
||||
},
|
||||
"target": "es2022",
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
import React from "react";
|
||||
|
||||
interface ListProps {
|
||||
callback: () => void;
|
||||
}
|
||||
|
||||
const SomeList = ({ callback }: ListProps) => {
|
||||
callback();
|
||||
|
||||
return <div />;
|
||||
};
|
||||
|
||||
const list = [0];
|
||||
|
||||
const MyComponent = (): JSX.Element => {
|
||||
return (
|
||||
<div>
|
||||
{list.map(() =>
|
||||
true ? (
|
||||
<SomeList
|
||||
callback={(): void => console.log("do something")}
|
||||
/>
|
||||
) : (
|
||||
<div />
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
@ -0,0 +1,14 @@
|
||||
import React from "react";
|
||||
const SomeList = ({ callback })=>{
|
||||
callback();
|
||||
return /*#__PURE__*/ React.createElement("div", null);
|
||||
};
|
||||
const list = [
|
||||
0
|
||||
];
|
||||
const MyComponent = ()=>{
|
||||
return /*#__PURE__*/ React.createElement("div", null, list.map(()=>true ? /*#__PURE__*/ React.createElement(SomeList, {
|
||||
callback: ()=>console.log("do something")
|
||||
}) : /*#__PURE__*/ React.createElement("div", null)
|
||||
));
|
||||
};
|
Loading…
Reference in New Issue
Block a user