1.1.0 • Published 4 years ago
react-render-static v1.1.0
react-render-static
A tool (with CLI) for rendering React Components. Uses custom React renderer that does not perform any Html semantics validation.
Supports babel.
Usage
Library
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>Command line
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.jsOutput:
<div>Hello World!</div>