Skip to content

Commit 76663c3

Browse files
docs(readme): document type error under v5
Relates to #1126
1 parent 312a565 commit 76663c3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: README.md

+14
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,20 @@ Migrated to TypeScript. CommonJS imports require the `.default` key:
437437
const parse = require('html-react-parser').default;
438438
```
439439

440+
If you're getting the error:
441+
442+
```
443+
Argument of type 'ChildNode[]' is not assignable to parameter of type 'DOMNode[]'.
444+
```
445+
446+
Then use type assertion:
447+
448+
```ts
449+
domToReact(domNode.children as DOMNode[], options);
450+
```
451+
452+
See [#1126](https://github.com/remarkablemark/html-react-parser/issues/1126#issuecomment-1784188447).
453+
440454
### v4
441455

442456
[htmlparser2](https://github.com/fb55/htmlparser2) has been upgraded to [v9](https://github.com/fb55/htmlparser2/releases/tag/v9.0.0).

0 commit comments

Comments
 (0)