Created
August 10, 2018 02:37
-
-
Save dance2die/c861dc490bd4eec2e28fdb098ea0a3a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createMarkup(html) { | |
return { __html: html }; | |
} | |
const RedditPost = ({ | |
post: { title, selftext, id, url, thumbnail }, | |
order | |
}) => ( | |
<div className="redditPost"> | |
<p className="postTitle"> | |
<a href={url} target="_blank"> | |
#{order} {title} | |
</a> | |
</p> | |
<div | |
className="redditText" | |
dangerouslySetInnerHTML={createMarkup(selftext)} | |
/> | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment