purescript-react-basic-hooks
purescript-react-basic-hooks copied to clipboard
Array of JSX is not allowed
The type of component function does not allow to create react component with Array JSX return.
This should get compile, because react library allowes this syntax.
mkCounter :: Component Int
mkCounter = do
component "Counter" \initialValue -> React.do
counter /\ setCounter <- useState initialValue
pure
$ [ R.button
{ onClick: handler_ do
setCounter (_ + 1)
, children:
[ R.text $ "Increment: " <> show counter ]
}
]