Skip to content

Instantly share code, notes, and snippets.

@codeocelot
Last active April 29, 2017 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeocelot/87ffc4f9a076a203d99adeb7a2d21cd4 to your computer and use it in GitHub Desktop.
Save codeocelot/87ffc4f9a076a203d99adeb7a2d21cd4 to your computer and use it in GitHub Desktop.
import React from 'react';
import PropTypes from 'prop-types';
import AsyncPostHoC from '...';
const PostView = (props) => (
<div>
<p>{props.title}</p>
<p>{props.body}</p>
</div>
);
PostView.propTypes = {
title: PropTypes.string,
body: PropTypes.string,
}
const Post = (props) => (
<AsyncPostHoC postId={props.postId}>
<PostView {...props} />
</AsyncPostHoC>
);
Post.propTypes = {
postId: PropTypes.string.isRequired,
}
export default Post;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment