There was an error while loading. Please reload this page.
1 parent 0f981c4 commit 08bcc39Copy full SHA for 08bcc39
app/javascript/bundles/HelloWorld/HelloWorld.re
app/javascript/bundles/HelloWorld/HelloWorld.res
@@ -0,0 +1,17 @@
1
+@react.component
2
+let make = (~nameProp: string) => {
3
+ let (name, setName) = React.useState(() => nameProp)
4
+
5
+ <div>
6
+ <h3> {("Hello, " ++ name ++ "!") -> React.string} </h3>
7
+ <form>
8
+ <label htmlFor="name"> {"Say hello to:" -> React.string} </label>
9
+ <input
10
+ id="name"
11
+ type_="text"
12
+ value=name
13
+ onChange={event => setName(event -> Utils.eventTargetValue)}
14
+ />
15
+ </form>
16
+ </div>
17
+}
0 commit comments