deku-element-to-jsx-string

1.1.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i deku-element-to-jsx-string

Weekly Downloads

4

Version

1.1.1

License

MIT

Last publish

Collaborators

  • ellell