2.4.0 • Published 7 years ago

r-dom v2.4.0

Weekly downloads
789
License
-
Repository
github
Last release
7 years ago

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

  • tag String - A React.DOM tag string
  • properties Object optional - An object containing the properties you'd like to set on the element.
  • children Array|String optional - An array of r children or a string. This will create child elements or a text node, respectively.

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

Returns a React element

  • component Function - A React.js Component class created with React.createClass
  • properties Object optional - An object containing the properties you'd like to set on the element.
  • children Array|String optional - An array of r children or a string. This will create child elements or a text node, respectively.

Special Properties

  • isRendered "Boolean" optional - If falsy, React will skip rendering the target component.
  • classSet Object optional - Apply classnames and assign to className.
2.4.0

7 years ago

2.3.2

7 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.0

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago