1.1.0 • Published 3 years ago

react-render-static v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

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.js

Output:

<div>Hello World!</div>

License

MIT