Hacker News new | past | comments | ask | show | jobs | submit login
A nice way to render Markdown in React apps (jordaneldredge.com)
19 points by CharlesW 14 days ago | hide | past | favorite | 6 comments



Why do you need react to render static blog posts?

The page isn't static.

I dug back six or seven of the blog posts and they all looked static enough to me - my point is that react is complete overkill for sites like this.

The blog post content may be static, the page is not.

Why is react overkill here?


The security discussion didn't make sense to me but left me feeling the process was not secure.

It says the code is safe because it uses safe React APIs, but if you look at the code it's clearly using "dangerouslySetInnerHTML". However, if the markdown is trusted, this should be fine. I would suggest an established library to handle this for you though, unless you want to do it highly specialised and customised (which I think they're doing here).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: