jsonmltoreact
JsonML to React converter
Install
$ npm i --save jsonmltoreact
Examples
;;;; // Some random React componentComponent { return <div className="customCompoenentContainer"> thispropsheader && <h1>thispropsheader</h1> thispropssubheader && <h2>thispropssubheader</h2> thispropschildren </div> ; } // Create instance with custom converterslet jsonmlToReact = type: CustomCompoenent props: ...props ...data props: className: 'foobar' ; // JsonML treelet jsonml = 'div' class: 'container' 'custom-tag' subheader: 'bar' 'span' 'content' ; // Optional data to be passed to converterslet data = 'header': 'foo'; let reactComponent = jsonmlToReact; console;/*<div class="container"> <div class="customCompoenentContainer"> <h1>foo</h1> <h2>bar</h2> <span class="foobar">content</span> </div></div>*/