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

https://github.com/featurist/pogo-react

React.js components in PogoScript instead of JSX
https://github.com/featurist/pogo-react

Last synced: 20 days ago
JSON representation

React.js components in PogoScript instead of JSX

Awesome Lists containing this project

README

          

# pogo-react

A little DSL for writing [react.js](http://facebook.github.io/react/) components as [PogoScript](http://pogoscript.org) CommonJS modules, instead of using [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html)

## Usage

Start with a module looking like this:

module.exports = component {
render () =
div (
p { id = 'para' } "First paragraph"
p { class = 'zomg' } "Second paragraph"
)
}

...compile it to JavaScript like this:

require('pogo-react').compile! ("./component.pogo", "./component.js")

...then use it from React like this:

Component = require('./component.js')
instance = Component { prop = 'value' }
React.renderComponent(instance, document.body)

## License

BSD