Help with dangerouslySetInnerHTML

So I am trying work on my build a markdown previewer and I am struggling so hard with this. I tried using dangerouslySetInnerHTML and when I did, the whole thing just disappeared on codepen and works when I took it out. I found out when using marked, I had to use an older version to get it to work; but when I tried that with React and ReactDom, it keeps telling me that it isn’t defined.

These projects are just so frustrating as I always get stuck on them.

Please link to your Codepen.

Here is my codepen for my Markdown Preview.

Edit-I left the dangerouslySetInnerHTML as a note currently until I can figure the issue out or finish working on it, otherwise everything will be blank.

Seems to work? At least it did when I uncommented it.

Odd, it wasn’t working earlier before I commented it. I did change some of the react and reactdom and marked, so maybe that is what fixed it.

Well, thank you anyways. Whatever the problem was, I guess sort of resolved itself.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.