@@ -31,33 +31,37 @@ module PlaygroundHero = {
3131 {
3232 res : ` module Button = {
3333 @react.component
34- let make = (~count: int ) => {
34+ let make = (~count) => {
3535 let times = switch count {
3636 | 1 => "once"
3737 | 2 => "twice"
38- | n => Belt. Int.toString(n) ++ " times"
38+ | n => n-> Int.toString ++ " times"
3939 }
40- let msg = " Click me " ++ times
40+ let text = \` Click me $ \{ times\}\`
4141
42- <button> {msg ->React.string} </button>
42+ <button> {text ->React.string} </button>
4343 }
4444}` ,
45- js : ` var React = require( "react") ;
45+ js : ` import * as JsxRuntime from "react/jsx-runtime" ;
4646
47- function Playground$Button(Props ) {
48- var count = Props .count;
47+ function Playground$Button(props ) {
48+ var count = props .count;
4949 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+ });
5456}
5557
5658var Button = {
5759 make: Playground$Button
5860};
5961
60- exports.Button = Button;` ,
62+ export {
63+ Button,
64+ }` ,
6165 },
6266 ]
6367
0 commit comments