Skip to content

Commit 21b45a4

Browse files
docs(readme): update TypeScript example with Element type
1 parent db456cb commit 21b45a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ parse('<p id="replace">text</p>', {
179179
For TypeScript projects, check that `domNode` is an instance of domhandler's `Element`:
180180

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

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

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

377377
parse('<br class="remove">', {
378378
replace: domNode => {
@@ -446,7 +446,7 @@ See [#62](https://github.com/remarkablemark/html-react-parser/issues/62) and [ex
446446
447447
#### TS Error: Property 'attribs' does not exist on type 'DOMNode'
448448
449-
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).
449+
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).
450450
451451
## Performance
452452

0 commit comments

Comments
 (0)