mirror of
https://github.com/rowtype-yoga/purescript-nextjs-template.git
synced 2024-11-22 11:02:52 +03:00
Fix broken linkgs. Add basic counter
This commit is contained in:
parent
9ff766ad70
commit
f2b8e19695
@ -1,2 +1,3 @@
|
||||
import { mkPage } from "../output/Page/index";
|
||||
export default mkPage();
|
||||
'use client'
|
||||
import { mkPage } from '../output/Page/index'
|
||||
export default mkPage()
|
||||
|
@ -12,5 +12,4 @@ mkRootLayout = do
|
||||
pure $ \{ children } -> R.html {}
|
||||
[ R.head { lang: "en" } React.empty
|
||||
, R.body {} children
|
||||
|
||||
]
|
||||
|
@ -2,11 +2,17 @@ module Page where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Data.Tuple.Nested ((/\))
|
||||
import React.Basic.DOM.Simplified.Generated as R
|
||||
import React.Basic.Events (handler_)
|
||||
import React.Basic.Hooks as React
|
||||
|
||||
mkPage :: React.Component {}
|
||||
mkPage = do
|
||||
pure $ \props -> R.main {}
|
||||
[ R.div {} "Hello World"
|
||||
]
|
||||
React.component "Page" \props -> React.do
|
||||
counter /\ setCounter <- React.useState' 0
|
||||
pure $ R.main {}
|
||||
[ R.button { onClick: handler_ (setCounter $ counter - 1) } "-"
|
||||
, R.div {} $ show counter
|
||||
, R.button { onClick: handler_ (setCounter $ counter + 1) } "+"
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user