File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -31,33 +31,35 @@ module PlaygroundHero = {
31
31
{
32
32
res : ` module Button = {
33
33
@react.component
34
- let make = (~count: int ) => {
34
+ let make = (~count) => {
35
35
let times = switch count {
36
36
| 1 => "once"
37
37
| 2 => "twice"
38
- | n => Belt. Int.toString(n) ++ " times"
38
+ | n => n-> Int.toString ++ " times"
39
39
}
40
- let msg = "Click me " ++ times
41
40
42
- <button> {msg ->React.string} </button>
41
+ <button> {\` Click me $ \{ times \}\` ->React.string} </button>
43
42
}
44
43
}` ,
45
- js : ` var React = require( "react") ;
44
+ js : ` import * as JsxRuntime from "react/jsx-runtime" ;
46
45
47
- function Playground$Button(Props ) {
48
- var count = Props .count;
46
+ function Playground$Button(props ) {
47
+ var count = props .count;
49
48
var times = count !== 1 ? (
50
- count !== 2 ? String(count) + " times" : "twice"
51
- ) : "once";
52
- var msg = "Click me " + times;
53
- return React.createElement("button", undefined, msg);
49
+ count !== 2 ? count.toString() + " times" : "twice"
50
+ ) : "once";
51
+ return JsxRuntime.jsx("button", {
52
+ children: "Click me " + times
53
+ });
54
54
}
55
55
56
56
var Button = {
57
57
make: Playground$Button
58
58
};
59
59
60
- exports.Button = Button;` ,
60
+ export {
61
+ Button,
62
+ }` ,
61
63
},
62
64
]
63
65
You can’t perform that action at this time.
0 commit comments