html-tsx
v1.6.0
Published
Transform tsx to HTML string
Downloads
24
Maintainers
Readme
html-tsx
Transform tsx to HTML string
Setup
tsconfig.json
{
"compilerOptions": {
"jsx": "react",
"jsxFactory": "pragma"
}
}
Usage
import { pragma } from 'html-tsx'
const renderToString = (name: string) => (
<div class="one two three">
<p id="line">
Hello, {name}!
</p>
</div>
)
console.log(renderToString('world'))
// => <div class="one two three"><p id="line">Hello, world!</p></div>