Use ReactDOMServer.renderToString to render html from JSONX
options for getReactElementFromJSONX
options used to inject html via ReactDOM.render
any valid JSONX JSON object
any additional resource used for asynchronous properties
React genereated html via JSONX JSON
// Uses react to create <div class="jsonx-generated"><p style="color:red;">hello world</p></div>jsonx.outputHTML({ jsonx: { component: 'div', props:{className:'jsonx-generated',children:[{ component:'p',props:{style:{color:'red'}}, children:'hello world' }]}}, }); Copy
// Uses react to create <div class="jsonx-generated"><p style="color:red;">hello world</p></div>jsonx.outputHTML({ jsonx: { component: 'div', props:{className:'jsonx-generated',children:[{ component:'p',props:{style:{color:'red'}}, children:'hello world' }]}}, });
Use ReactDOMServer.renderToString to render html from JSONX