-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreturn_expression_like.tsx
62 lines (51 loc) · 1.23 KB
/
return_expression_like.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import * as React from "react";
export function ReturnExpressFragmentLike() {
function InnerFunctionComponent() {
return <h2></h2>;
}
return (
<>
<InnerFunctionComponent />
<h1>Hello from typescript transformer</h1>
</>
);
}
export function ReturnExpressTerenaryLeftLike() {
function InnerFunctionComponent() {
return <h2></h2>;
}
return true ? (
<div>
<InnerFunctionComponent />
<h1>Hello from typescript transformer</h1>
</div>
) : (
<div>Conditional Expression</div>
);
}
export function ReturnExpressTerenaryRightLike() {
return true ? null : <div>Conditional Expression</div>;
}
export function ReturnBinaryExpressionLike() {
function InnerFunctionComponent() {
return <h2></h2>;
}
return (
true && (
<div>
<InnerFunctionComponent />
<h1>Hello from typescript transformer</h1>
</div>
)
);
}
export function ReturnExpressionClosureFunctionLike() {
function render() {
return true ? null : <div>Conditional Expression</div>;
}
return render();
}
export function ReturnExpressionClosureArrowFunctionLike() {
const arrow_render = () => (true ? null : <div>Conditional Expression</div>);
return arrow_render();
}