Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jedwatson/react-domify
Like JSON.strinfigy but uses React to generate DOM elements
https://github.com/jedwatson/react-domify
Last synced: 14 days ago
JSON representation
Like JSON.strinfigy but uses React to generate DOM elements
- Host: GitHub
- URL: https://github.com/jedwatson/react-domify
- Owner: JedWatson
- License: mit
- Created: 2014-12-25T06:38:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-10-29T10:31:27.000Z (about 5 years ago)
- Last Synced: 2024-05-29T00:02:33.210Z (6 months ago)
- Language: JavaScript
- Size: 913 KB
- Stars: 54
- Watchers: 4
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React DOMify
Like JSON.strinfigy but uses React.js to generate DOM elements.
## Demo & Examples
Live demo: [JedWatson.github.io/react-domify](http://JedWatson.github.io/react-domify/)
To build the examples locally, run:
```
npm install
gulp dev
```Then open [`localhost:8000`](http://localhost:8000) in a browser.
## Installation
The easiest way to use react-domify is to install it from NPM and include it in your own React build process (using [Browserify](http://browserify.org), [Webpack](http://webpack.github.io/), etc).
You can also use the standalone build by including `dist/react-domify.js` in your page. If you use this, make sure you have already included React, and it is available as a global variable.
```
npm install react-domify --save
```## Usage
Provide the variable to render as the `value` property.
```
var DOMify = require('react-domify');var data = {
str: 'It formats strings, numbers, booleans and dates',
bool: true,
date: new Date(),
num: 42,
arr: [
'And nested arrays / objects',
{
key: 'value'
}
]
};```
### License
MIT. Copyright (c) 2016 Jed Watson.