ls-react

1.1.4 • Public • Published

ls-react

A little library to make writing React code in LiveScript a little nicer.

Usage

require! {
  react: {use-state}
  'react-dom': ReactDOM
  'ls-react': {h, div, button, h1, p}
}
 
App = ({ title }) ->
  [count, set-count] = use-state 0
  increment = -> set-count count + 1
 
  div {},
    h1 class-name: 'heading', title
    p {} "Count is: #{count}"
    b on-click: increment, "+"
 
ReactDOM.render(
  h App, title: 'Yo!'
  document.getElementById "root"
)

For more usage examples, check out the examples directory.

Package Sidebar

Install

npm i ls-react

Weekly Downloads

2

Version

1.1.4

License

ISC

Unpacked Size

19.2 kB

Total Files

24

Last publish

Collaborators

  • seanclayton