mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 11:11:30 +03:00
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
//@filename: file.tsx
|
|
//@jsx: react
|
|
declare module JSX {
|
|
interface Element { }
|
|
interface IntrinsicElements {
|
|
[s: string]: any;
|
|
}
|
|
}
|
|
declare var React: any;
|
|
|
|
var p;
|
|
var selfClosed1 = <div />;
|
|
var selfClosed2 = <div x="1" />;
|
|
var selfClosed3 = <div x='1' />;
|
|
var selfClosed4 = <div x="1" y='0' />;
|
|
var selfClosed5 = <div x={0} y='0' />;
|
|
var selfClosed6 = <div x={"1"} y='0' />;
|
|
var selfClosed7 = <div x={p} y='p' b />;
|
|
|
|
var openClosed1 = <div></div>;
|
|
var openClosed2 = <div n='m'>foo</div>;
|
|
var openClosed3 = <div n='m'>{p}</div>;
|
|
var openClosed4 = <div n='m'>{p < p}</div>;
|
|
var openClosed5 = <div n='m' b>{p > p}</div>;
|
|
|
|
class SomeClass {
|
|
f() {
|
|
var rewrites1 = <div>{() => this}</div>;
|
|
var rewrites2 = <div>{[p, ...p, p]}</div>;
|
|
var rewrites3 = <div>{{p}}</div>;
|
|
|
|
var rewrites4 = <div a={() => this}></div>;
|
|
var rewrites5 = <div a={[p, ...p, p]}></div>;
|
|
var rewrites6 = <div a={{p}}></div>;
|
|
}
|
|
}
|
|
|
|
var whitespace1 = <div> </div>;
|
|
var whitespace2 = <div> {p} </div>;
|
|
var whitespace3 = <div>
|
|
{p}
|
|
</div>;
|