Skip to content

Commit 3bb4de0

Browse files
committed
Update playground hero
1 parent 540621d commit 3bb4de0

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/layouts/LandingPageLayout.res

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,35 @@ 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
4140
42-
<button> {msg->React.string} </button>
41+
<button> {\`Click me $\{times\}\`->React.string} </button>
4342
}
4443
}`,
45-
js: `var React = require("react");
44+
js: `import * as JsxRuntime from "react/jsx-runtime";
4645
47-
function Playground$Button(Props) {
48-
var count = Props.count;
46+
function Playground$Button(props) {
47+
var count = props.count;
4948
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+
});
5454
}
5555
5656
var Button = {
5757
make: Playground$Button
5858
};
5959
60-
exports.Button = Button;`,
60+
export {
61+
Button,
62+
}`,
6163
},
6264
]
6365

0 commit comments

Comments
 (0)