I have a Post component which will set the innerHtml using content retrieved from Firebase.
render() {
return (
<Panel>
<Image src={this.state.img} alt={this.state.title} />
<h2>{this.state.title}</h2>
<p className='date'>{this.state.name}</p>
<div className='text' ref='post'>
<div dangerouslySetInnerHTML={{__html: this.state.content}} />
</div>
</Panel>
)
The content to be displayed is stored in firebase as such:
{
"id": 11,
"title": "The Earth",
"slug": "the-lazy-mans-guide-to-anything-about-princess",
"img": "https://hd.unsplash.com/photo-1467321638755-7246fd0dc1f3",
"summary": "<p>In as name to here them deny wise this. As rapid woody my he me which. Men but they fail shew just wish next put. Led all visitor musical calling nor her. Within coming figure sex things are. Pretended concluded did repulsive education smallness yet yet described. Had country man his pressed shewing. No gate dare rose he. Eyes year if miss he as upon.</p>",
"content": "<p>In as name to here them deny wise this........
However, because React will not evaluate a script tag within the 'content', I cannot embed a gist. I've tried a couple alternatives but looking for suggestions.