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

https://github.com/jongacnik/monoapp-react

monoapp plugin to use React as a view layer
https://github.com/jongacnik/monoapp-react

Last synced: about 1 year ago
JSON representation

monoapp plugin to use React as a view layer

Awesome Lists containing this project

README

          

# monoapp-react

[monoapp](https://github.com/jongacnik/monoapp) plugin to use [React](https://github.com/facebook/react) as a view layer

## Example

```js
var monoapp = require('monoapp')
var withReact = require('monoapp-react')

var app = monoapp()

app.use(withReact)
app.route('/', view)
app.mount('#app')

function MyComponent () {
return

Hello World

}

function view (state, emit) {
return (



)
}
```

## Component

An instance of `React.Component` extended with `monoapp` state and emit is included:

```js
var { Component } = require('monoapp-react')

class MyComponent extends Component {
render () {
console.log(this.global)
console.log(this.emit)

return

Hello World

}
}
```