Skip to content

kamilziajka/react-render-static

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published