react-node-render
Simply render React components in Node.js
Node_module
npm install react-node-render --save
const render = const html = console
With options
const html =
Render to static
const html =
Cli
Install:
npm install react-node-render -g
Use:
rnr myComponent.jsx
myComponent.html is now created
Input
import React from 'react' import React from 'react'Component { thisstate = count: propsinitialCount } { this } { return <div => hello thisstatecount </div> }componentdefaultProps = initialCount: 1337
Output
hello 1337
or with static mode:
hello 1337
notes
- todo fix .babelrc dependency
- render to jade
- render to hbs
- rendering with react-router
- more awesome tests
- deeper error handeling
- more cli features
Created mainly to shoot out html for koa/express.js servers used together with a templating language.