Skip to content

Commit e0cf26c

Browse files
Merge pull request #788 from DZakh-forks/update-playground-hero
Update playground hero
2 parents ef739ff + 3fa8a44 commit e0cf26c

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/layouts/LandingPageLayout.res

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
5658
var Button = {
5759
make: Playground$Button
5860
};
5961
60-
exports.Button = Button;`,
62+
export {
63+
Button,
64+
}`,
6165
},
6266
]
6367

0 commit comments

Comments
 (0)