Skip to content

M1lan/purescript-react

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-react

React Bindings for PureScript.

WARNING: This is alpha quaility software and you need to use nightly build of React.

module Main where

import React
import React.DOM

hello = mkUI spec do
  props <- getProps
  return $ h1 [
      className "Hello"
    ] [
      text "Hello, ",
      text props.name
    ]

incrementCounter = do
  val <- readState
  writeState (val + 1)

counter = mkUI spec { getInitialState = return 0 } do
  val <- readState
  return $ p [
      className "Counter",
      onClick incrementCounter
    ] [
      text (show val),
      text " Click me to increment!"
    ]

main = do
  let component = div [] [hello {name: "World"}, counter {}]
  renderToBody component

About

React Bindings for PureScript

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • PureScript 86.4%
  • JavaScript 5.1%
  • Python 3.9%
  • Makefile 2.7%
  • HTML 1.9%