A tool (with CLI) for rendering React Components. Uses custom React renderer that does not perform any Html semantics validation.
Supports babel.
Pass an element to a render()
function:
import React from 'react';
import { render } from 'react-render-static';
const Compontent = () => <div>Hello World!</div>;
const output = render(<Compontent/>);
console.log(output);
Output:
<div>Hello World!</div>
Have an input file exporting React Component (default export):
import React from 'react';
export default () => <div>Hello World!</div>;
Run CLI:
$ react-render-static component.js
Output:
<div>Hello World!</div>