@bem/sdk.bemjson-to-jsx
v0.2.9
Published
Transform BEMJSON to JSX
Downloads
56
Readme
bemjson-to-jsx
Transforms BEMJSON objects to JSX markup.
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'}/>"