Last active
October 16, 2019 01:56
-
-
Save ntucker/9f12bca534f2951bf9422850e3a6d598 to your computer and use it in GitHub Desktop.
Post component using useResource
This file contains hidden or 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
function Post({ id }: { id: string }) { | |
const post = useResource(PostResource.detailShape(), { id }); | |
return ( | |
<article> | |
<h2>{post.title}</h2> | |
<p>{post.body}</p> | |
</article> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment