Skip to content

Commit

Permalink
docs(readme): update TypeScript example with Element type
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Dec 26, 2020
1 parent db456cb commit 21b45a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -179,7 +179,7 @@ parse('<p id="replace">text</p>', {
For TypeScript projects, check that `domNode` is an instance of domhandler's `Element`:

```tsx
import { Element } from 'domhandler/lib/node';
import parse, { Element } from 'html-react-parser';

parse('<p id="replace">text</p>', {
replace: domNode => {
Expand Down Expand Up @@ -372,7 +372,7 @@ TypeScript projects will need to check the types in [v1.0.0](https://github.com/
For `replace` option:

```tsx
import { Element } from 'domhandler/lib/node';
import parse, { Element } from 'html-react-parser';

parse('<br class="remove">', {
replace: domNode => {
Expand Down Expand Up @@ -446,7 +446,7 @@ See [#62](https://github.com/remarkablemark/html-react-parser/issues/62) and [ex

#### TS Error: Property 'attribs' does not exist on type 'DOMNode'

The TypeScript error happens because `DOMNode` needs be an instance of domhandler's `Element`. See [#199](https://github.com/remarkablemark/html-react-parser/issues/199).
The TypeScript error happens because `DOMNode` needs be an instance of domhandler's `Element`. See [migration](#migration) or [#199](https://github.com/remarkablemark/html-react-parser/issues/199).

## Performance

Expand Down

0 comments on commit 21b45a4

Please sign in to comment.