jakebresnehan / static-react

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

static-react

Zero-configuration CLI React static renderer

Build Status

Usage

CLI

static-react RootComponent.js > index.html

Options

  • -p, --props - pass props via a file that exports an object
  • --no-doctype - omit <!DOCTYPE html> from the beginning of the returned string

With ES2015 & JSX

To use this with ES2015 and JSX syntax, install Babel presets and create a .babelrc file or add a Babel configuration object to package.json.

npm i -D babel-preset-es2015 babel-preset-react

.babelrc

{
  "presets": [
    "es2015",
    "react"
  ]
}

Example

See /example


MIT License

About


Languages

Language:JavaScript 87.2%Language:HTML 12.8%