The latest version of react-haskell is 2.0.1-0.
react-haskell
Version 2.0.0 revision 0 uploaded by joelb.
Package meta
- Synopsis
- Haskell React bindings
- Description
This package provides high level bindings to Facebook's React library, meant for use with GHCJS.
React is a JavaScript library for building user interfaces. React (and React-Haskell) is focused on just UI - it's not a framework.
Currently React-Haskell can render simple stateful components, but not what React calls classes. Put another way, React-Haskell doesn't support lifecycle methods yet.
Here's a simple example which demonstrates basic elements, attributes, state, and handling events.
-- We're creating a class with JSString state data Example instance ReactKey Example where type ClassState Example = JSString type AnimationState Example = () type Signal Example = JSString -- updating to the new state without animation transition :: JSString -> JSString -> (JSString, [AnimConfig Example]) transition oldState signal = (signal, []) view :: JSString -> React Example () view str = div_ [ class_ "container" ] $ do input_ [ value_ str, onChange (Just . value . target) ] main :: IO () main = withElem "id" $ \elem -> render elem =<< createClass view transition "" () []
- Author
- Joel Burget
- Bug reports
- https://github.com/joelburget/react-haskell/issues
- Category
- Web
- Copyright
- n/a
- Homepage
- https://github.com/joelburget/react-haskell
- Maintainer
- joelburget@gmail.com
- Package URL
- n/a
- Stability
- n/a