Last active
December 14, 2015 15:19
-
-
Save lamosty/74d51604e803800abb40 to your computer and use it in GitHub Desktop.
AboutPage dumb component from the Lexi React WP theme: https://github.com/lamosty/lexi/blob/master/src/components/AboutPage.js
This file contains hidden or 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
import React, { Component } from 'react'; | |
// Dumb component | |
export default class AboutPage extends Component { | |
createMarkup(html) { | |
return { | |
__html: html | |
} | |
} | |
render() { | |
const { page } = this.props; // Extract the page from the component's props. | |
return ( | |
<div className="blog-post"> | |
<h2 className="blog-post-title">{page.title.rendered}</h2> | |
<div dangerouslySetInnerHTML={this.createMarkup(page.content.rendered)} /> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment