Skip to content

Instantly share code, notes, and snippets.

@lamosty
Last active December 14, 2015 15:19
Show Gist options
  • Save lamosty/74d51604e803800abb40 to your computer and use it in GitHub Desktop.
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
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