react-render-static
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i react-render-static

Weekly Downloads

8

Version

1.1.0

License

MIT

Unpacked Size

24.4 kB

Total Files

31

Last publish

Collaborators

  • kazet