Last active
April 29, 2017 22:02
-
-
Save codeocelot/87ffc4f9a076a203d99adeb7a2d21cd4 to your computer and use it in GitHub Desktop.
This file contains 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 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