Skip to content

Commit 3fa8a44

Browse files
committed
Move text to variable
1 parent 3bb4de0 commit 3fa8a44

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/layouts/LandingPageLayout.res

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ module PlaygroundHero = {
3737
| 2 => "twice"
3838
| n => n->Int.toString ++ " times"
3939
}
40+
let text = \`Click me $\{times\}\`
4041
41-
<button> {\`Click me $\{times\}\`->React.string} </button>
42+
<button> {text->React.string} </button>
4243
}
4344
}`,
4445
js: `import * as JsxRuntime from "react/jsx-runtime";
@@ -48,8 +49,9 @@ function Playground$Button(props) {
4849
var times = count !== 1 ? (
4950
count !== 2 ? count.toString() + " times" : "twice"
5051
) : "once";
52+
var text = "Click me " + times;
5153
return JsxRuntime.jsx("button", {
52-
children: "Click me " + times
54+
children: text
5355
});
5456
}
5557

0 commit comments

Comments
 (0)