Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sean-clayton/ls-react

A little library to make writing React code in LiveScript a little nicer.
https://github.com/sean-clayton/ls-react

functional-programming javascript livescript react

Last synced: 22 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# ls-react

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

### Usage

```ls
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.