Skip to content

Instantly share code, notes, and snippets.

@lamosty

lamosty/AboutPage.js

Last active Dec 14, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.