@hackage react-haskell1.2.0.0

Haskell React bindings

This package provides high level bindings to Facebook's React library, meant for use with Haste.

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.

statefulView :: StatefulReact JSString ()
statefulView = div_ <! class_ "container" $ do
    str <- getState
    input_ <! value_ str
           <! onChange (\_ evt -> toJSStr $ map toUpper $ fromJSStr $ targetValue evt)