How to insert custom component into dangerouslySetInnerHTML (React JS)?

41 Views Asked by At

I want to see if there's a way I can traverse through the string (html as text) that is going to be inserted ad dangerouslySetInnerHTML in a component, and see if I can change the img tags from that string to a custom component in react. I haven't find a way, and have no idea where to begin with. I dont know if this needs to be recursive to somehow traverse the nodes.

Is this possible?

0

There are 0 best solutions below