Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/eliot-akira/jsxidom

Transform JSX to incremental DOM with Babel
https://github.com/eliot-akira/jsxidom

Last synced: about 1 month ago
JSON representation

Transform JSX to incremental DOM with Babel

Awesome Lists containing this project

README

        

# [JSXIDOM](https://github/eliot-akira/jsxidom)

Transform JSX to incremental DOM with Babel

## Use

Install

~~~bash
$ npm i jsxidom --save-dev
~~~

In *.babelrc*

~~~json
"plugins": [
["transform-react-jsx", { "pragma": "jsxidom" }]
]
~~~

In application

~~~javascript
require('jsxidom');
~~~

The above line is required once. In addition to building incremental DOM from JSX, it provides a *render* method to HTML element.

Example use case

~~~javascript
const app = document.body.querySelector('#app')

let i = 0

function refresh() {
app.render(

{ i++ }
)
}

refresh()
setInterval( refresh, 1000 )
~~~