Skip to content

Instantly share code, notes, and snippets.

Last active Dec 14, 2015
What would you like to do?
AboutPage dumb component from the Lexi React WP theme:
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)} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment