1.1.1 • Published 8 years ago

deku-element-to-jsx-string v1.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

deku-element-to-jsx-string Build Status

Generate jsx string representation from deku element

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install deku-element-to-jsx-string --save

Usage

Component must have a defined name to be able to generate string representation

const Component = {
  render: function () {
    return <div></div>;
  },
  name: 'Component'
};

function callback () {}

const jsxString = elementToString(<Component string='string' callback={callback} boolean={true} object={{ foo: 'bar' }} />);
console.log(jsxString);
// output:
// const object = {
//  foo: 'bar'
// };
// '<Component string=\'string\' callback={function} boolean={true} object={object}/>'

Tests

npm install
npm test

Dependencies

Dev Dependencies

License

MIT

Generated by package-json-to-readme