# react-dom-wrapper

> A (somewhat) helpful wrapper function for creating React elements

Latest version **4.1.0** (published 2016-03-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-dom-wrapper
pnpm add react-dom-wrapper
yarn add react-dom-wrapper
bun add react-dom-wrapper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2016-03-26 |
| First published | 2015-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Arne Martin Aurlien |
| Maintainers | arnemart |
| Keywords | react, reactjs, dom |

## Links

- npm: https://www.npmjs.com/package/react-dom-wrapper
- Repository: https://github.com/arnemart/react-dom-wrapper
- Issues: https://github.com/arnemart/react-dom-wrapper/issues
- npm.io page: https://npm.io/package/react-dom-wrapper

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 4.1.0 (latest) — 2016-03-26
- 4.0.0 — 2016-02-24
- 3.0.2 — 2016-01-14
- 3.0.1 — 2016-01-11
- 3.0.0 — 2015-06-19
- 2.0.1 — 2015-05-15
- 2.0.0 — 2015-04-15
- 1.1.1 — 2015-03-30
- 1.1.0 — 2015-03-12
- 1.0.0 — 2015-03-12

## README

# react-dom-wrapper [![Build Status](https://travis-ci.org/arnemart/react-dom-wrapper.svg?branch=master)](https://travis-ci.org/arnemart/react-dom-wrapper)

Convert an array of element data to react elements. Prettier than JSX, less verbose than using React.DOM directly. Inspired by (though not as pretty as) [Hiccup](https://github.com/weavejester/hiccup).

Installation
------------

```
$ npm install [--save] react-dom-wrapper
```

Usage
-----

```javascript
var DOM = require('react-dom-wrapper');

var element = DOM([
    'div#wrapper',
    { className: 'asd' },
    ['span.message.important', 'hello', ['span.bold', name]],
    [CustomComponent, { customProp: 'hello' }],
    [
        'ul',
        arrayOfThings.map(function(thing) {
            return ['li', { key: thing.id }, thing.value]
        })
    ]
]);

React.render(element, mountNode);
```

Using a custom React
-----------------------

If you want to use a different version of React entirely, you can do `var DOM = require('react-dom-wrapper/react-dom-wrapper')(myCustomReact)`.

Element spec
------------

An element is an array consisting of:

1. Element type (string or React component)
2. Optional props object
3. Zero or more children (string, element spec, React element, or an array (can even be nested) of any of those)

Testing
-------

There are test! [Buster](http://busterjs.org) is used. `npm test` runs the test, `npm run autotest` watches the files and runs tests automatically.

License
-------

MIT

---
_Source: https://npm.io/package/react-dom-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
