peternewnham / react-html-parser

Converts HTML strings directly into React components and provide a simple way to modify and replace the content.
https://peternewnham.github.io/react-html-parser
MIT License
781 stars 103 forks source link

No HTML renders after the custom React component using the transform function #108

Open kaijuh opened 2 months ago

kaijuh commented 2 months ago

Hello,

Thanks for putting this together by the way. It works great.

The only issue I am having is that nothing renders after my custom React Component. I am using the transform function according to the example of someone who got it working in a closed issue

{ReactHtmlParser(post.content, {transform(node:any, index: any, value:any){if (node.type === 'tag' && node.name === 'noteemail') {return <NoteEmail key={index}/>} }})}

Everything renders before the component but nothing renders after the component.

I was looking through the Readme but couldnt figure out what I was doing wrong.

Thanks