File tree Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -29,32 +29,24 @@ import Prelude
2929import Control.Monad.Eff
3030
3131import React
32- import React.DOM
3332
34- hello = mkUI (spec unit) \ctx -> do
35- props <- getProps ctx
36- return $ h1 [ className "Hello"
37- ]
38- [ text "Hello, "
39- , text props.name
40- ]
33+ import qualified React.DOM as D
34+ import qualified React.DOM.Props as P
4135
4236incrementCounter ctx e = do
4337 val <- readState ctx
4438 writeState ctx (val + 1)
4539
4640counter = mkUI (spec 0) \ctx -> do
4741 val <- readState ctx
48- return $ p [ className "Counter"
49- , onClick (incrementCounter ctx)
50- ]
51- [ text (show val)
52- , text " Click me to increment!"
53- ]
42+ return $ D. p [ P. className "Counter"
43+ , P. onClick (incrementCounter ctx)
44+ ]
45+ [ D. text (show val)
46+ , D. text " Click me to increment!"
47+ ]
5448
5549main = do
56- let component = div [] [ hello { name: "World" }
57- , counter {}
58- ]
50+ let component = D.div [] [ counter {} ]
5951 renderToBody component
6052```
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ import qualified React.DOM.Props as P
1212
1313foreign import interval :: forall eff a .
1414 Int ->
15- Eff ( console :: CONSOLE | eff ) a ->
16- Eff ( console :: CONSOLE | eff ) Unit
15+ Eff eff a ->
16+ Eff eff Unit
1717
1818hello = mkUI (spec unit) \ctx -> do
1919 props <- getProps ctx
You can’t perform that action at this time.
0 commit comments