Skip to content

Commit

Permalink
docs: htmltojsx
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Sep 29, 2023
1 parent 887a466 commit 37b4e85
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ to generate HTML. Here are two options for importing the `@kitajs/html` package:

```tsx
// my-file.tsx
import Html from '@kitajs/html';

console.log(<div>Html import needs to be in scope!</div>);
```
Expand Down Expand Up @@ -288,7 +287,6 @@ const async = (

async instanceof Promise;


const sync: string = (
<div>
<Sync />
Expand Down Expand Up @@ -474,9 +472,9 @@ if (html instanceof Promise) {
## Migrating from HTML

Migrating from plain HTML to JSX can be a pain to convert it all manually, as you will
find yourself hand placing quotes and closing void elements. Luckily for us, there's a
tool called [htmltojsx](https://magic.reactjs.net/htmltojsx.htm) that can help us with
that.
find yourself hand placing quotes and closing void elements.

You can use [**Html To Jsx**](https://magic.reactjs.net/htmltojsx.htm).

```html
<!-- Hello world -->
Expand All @@ -487,7 +485,7 @@ that.
<p>Enter your HTML here</p>
```

Generates:
Results into:

```tsx
<>
Expand Down Expand Up @@ -852,7 +850,6 @@ an external JS library to do so, like
[html-prettify](https://www.npmjs.com/package/html-prettify).

```tsx
import Html from '@kitajs/html';
import prettify from 'html-prettify';

const html = (
Expand Down

0 comments on commit 37b4e85

Please sign in to comment.