@@ -31,33 +31,37 @@ 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
40
+ let text = \` Click me $ \{ times\}\`
41
41
42
- <button> {msg ->React.string} </button>
42
+ <button> {text ->React.string} </button>
43
43
}
44
44
}` ,
45
- js : ` var React = require( "react") ;
45
+ js : ` import * as JsxRuntime from "react/jsx-runtime" ;
46
46
47
- function Playground$Button(Props ) {
48
- var count = Props .count;
47
+ function Playground$Button(props ) {
48
+ var count = props .count;
49
49
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);
50
+ count !== 2 ? count.toString() + " times" : "twice"
51
+ ) : "once";
52
+ var text = "Click me " + times;
53
+ return JsxRuntime.jsx("button", {
54
+ children: text
55
+ });
54
56
}
55
57
56
58
var Button = {
57
59
make: Playground$Button
58
60
};
59
61
60
- exports.Button = Button;` ,
62
+ export {
63
+ Button,
64
+ }` ,
61
65
},
62
66
]
63
67
0 commit comments