remarkablemark / html-react-parser

📝 HTML to React parser.
https://b.remarkabl.org/html-react-parser
MIT License
2.14k stars 130 forks source link

Can this render a custom React component found within the HTML? #1495

Open kaijuh opened 2 months ago

kaijuh commented 2 months ago

Question

Can this package render a custom React component. If so, could you provide an example of how to implement that?

I was using a similar package as this and I am able to render my custom React component but the issue I am running into is that none of the HTML found after the custom react component is being rendered.

Thanks

Keywords

custom react component

remarkablemark commented 2 months ago

@kaijuh This package only converts an HTML string to React elements. To convert a JSX string to React elements, you can use something like react-jsx-parser.