uber-archive / r-dom

React DOM wrapper
MIT License
263 stars 18 forks source link

r-dom Build Status

React DOM wrapper.

Usage

var React = require('react');
var r = require('r-dom');

var AnotherComponent = require('./another-component');

module.exports = React.createClass({
  render: function render() {
    return (
      r.div({className: 'example'}, [
        r.h1('Hello World!'),
        r.h2('This is React.js markup'),
        r(AnotherComponent, {foo: 'bar'}),
        r.div({
          classSet: { // Automatically use `classnames` module for classSet
            foo: this.props.foo,
            bar: this.props.bar
          },
          isRendered: this.props.foo // div won't render if isRendered is falsy
        })
      ])
    );
  }
});

Documentation

r[tag]([properties], [children])

Returns a React element

r(component, [properties], [children])

Returns a React element

Special Properties