@bem/sdk.bemjson-to-jsx

0.2.9 • Public • Published

bemjson-to-jsx

Transforms BEMJSON objects to JSX markup.

NPM Status

Install

$ npm install --save @bem/sdk.bemjson-to-jsx

Usage

const bemjsonToJSX = require('@bem/sdk.bemjson-to-jsx')();

const bemjson = {
    block: 'button2',
    mods: { theme: 'normal', size: 'm' },
    text: 'hello world'
};

const jsxTree = bemjsonToJSX.process(bemjson);

console.log(jsxTree.JSX);
// → "<Button2 theme={'normal'} size={'m'} text={'hello world'}/>"

Readme

Keywords

Package Sidebar

Install

npm i @bem/sdk.bemjson-to-jsx

Weekly Downloads

19

Version

0.2.9

License

MPL-2.0

Unpacked Size

31.7 kB

Total Files

8

Last publish

Collaborators

  • blond
  • qfox
  • tadatuta
  • veged
  • vithar
  • yeti-or