You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data Message
= Hello
| Bye
instance showMessage :: Show Message where
show Hello = "Hello :)"
show Bye = "Bye!"
cls :: ReactClass Message
cls = createClass (spec unit renderFn)
where
renderFn this = do
msg <- getProps this
pure $ div' [ text (show msg) ]
When rendering it PureScript will fail to pattern match on Hello and Bye and will error.
index.js:34228 Uncaught Error: Failed pattern match at Main line 24, column 1 - line 24, column 37: Object
The text was updated successfully, but these errors were encountered:
we do that for him for props the same way it is done for state already
I prefer the second choice as it will support all the language features out of the box, but this adds some runtime overhead (creating the wrapper objects & gc them after they become unreferenced).
Consider a react class:
When rendering it PureScript will fail to pattern match on
Hello
andBye
and will error.The text was updated successfully, but these errors were encountered: