0.0.6 • Published 2 years ago

@coil-lang/react v0.0.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Thin React.js wrapper for coil-lang

Example:

import {component, use_state} from "@coil-lang/react"

@component
fn SimpleCounter({initial_value}) {
  let value = use_state(initial_value)

  fn clear = value.set!(0)
  fn decrement = value.update!(_ - 1 #(Math.max(& 0)))
  fn increment = value.update!(_ + 1)

  return ~:div[
    ~:button{onClick: clear, children: "Clear"}
    ~:button{onClick: decrement, children: "-1"}
    ~:span["Value: " value]
    ~:button{onClick: increment, children: "+1"}
  ]
}
0.0.5

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago