File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed
jscomp/syntax/tests/ppx/react Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,16 @@ module C1 = {
7
7
@react.component
8
8
let make = (~a = 2 , ~b ) => React .int (a + b )
9
9
}
10
+
11
+ module C2 = {
12
+ let a = "foo"
13
+ @react.component
14
+ let make = (~a = a ) => React .string (a )
15
+ }
16
+
17
+ module C3 = {
18
+ @react.component
19
+ let make = (~disabled as everythingDisabled : bool = false ) => {
20
+ React .string (everythingDisabled ? "true" : "false" )
21
+ }
22
+ }
Original file line number Diff line number Diff line change @@ -35,3 +35,42 @@ module C1 = {
35
35
\"DefaultValueProp$C1"
36
36
}
37
37
}
38
+
39
+ module C2 = {
40
+ let a = "foo"
41
+ type props<'a> = {a?: 'a}
42
+
43
+ let make = ({?a, _}: props<_>) => {
44
+ let a = switch a {
45
+ | Some(a) => a
46
+ | None => a
47
+ }
48
+
49
+ React.string(a)
50
+ }
51
+ let make = {
52
+ let \"DefaultValueProp$C2" = (props: props<_>) => make(props)
53
+
54
+ \"DefaultValueProp$C2"
55
+ }
56
+ }
57
+
58
+ module C3 = {
59
+ type props<'disabled> = {disabled?: 'disabled}
60
+
61
+ let make = ({disabled: ?everythingDisabled, _}: props<bool>) => {
62
+ let disabled = switch disabled {
63
+ | Some(disabled) => disabled
64
+ | None => false
65
+ }
66
+
67
+ {
68
+ React.string(everythingDisabled ? "true" : "false")
69
+ }
70
+ }
71
+ let make = {
72
+ let \"DefaultValueProp$C3" = (props: props<_>) => make(props)
73
+
74
+ \"DefaultValueProp$C3"
75
+ }
76
+ }
You can’t perform that action at this time.
0 commit comments