scrs
styled-components render static
npm i -g scrs
CLI
// App.js
import React from 'react'
import styled from 'styled-components'
const Heading = styled.h1`
color: tomato;
`
export default props => (
<React.Fragment>
<head>
{props.styles}
</head>
<Heading>
Hello
</Heading>
</React.Fragment>
)
scrs App.js > index.html
Node API
const React = require('react')
const scrs = require('scrs')
const App = require('./App')
const html = scrs(props => (
React.createElement(App, props)
))
Options
-
--svg
(boolean) use SVG doctype instead of HTML
MIT License