Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/vjeux/react-xtags

Using React to implement xtags
https://github.com/vjeux/react-xtags

Last synced: 24 days ago
JSON representation

Using React to implement xtags

Awesome Lists containing this project

README

        

react-xtags
===========

Using [x-tags](http://www.x-tags.org/) from Mozilla, we can write custom tags within the DOM and have them being rendered in [React](http://facebook.github.io/react/).

Read [this blog article for more information](http://blog.vjeux.com/2013/javascript/custom-components-react-x-tags.html).

```html

/** @jsx React.DOM */
var Hello = React.createClass({
render: function() {
return <div>{'Hello ' + this.props.name}</div>;
}
});

xreact.register('x-hello', Hello);

```

The rendered DOM tree lives in the shadow DOM. This lets us manipulate both the `` component as well as the rendered `

` using Web Inspector.

![image](https://f.cloud.github.com/assets/197597/658657/b58f239c-d5ff-11e2-887e-88f845938805.png)

Anytime you modify the `` component, whether it is in the inspector or in Javascript with the regular DOM API, React is going to be invoked to update the rendered version.