html-tsx
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

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>

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.6.01latest

Version History

VersionDownloads (Last 7 Days)Published
1.6.01
1.5.10
1.4.20
1.4.10
1.4.00
1.3.10
1.2.00
1.1.20
1.1.10
1.1.00
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i html-tsx

Weekly Downloads

1

Version

1.6.0

License

MIT

Unpacked Size

13.9 kB

Total Files

6

Last publish

Collaborators

  • progfay