-
-
Save simistern/9aea8f74279fe4f45910a0ce51c11542 to your computer and use it in GitHub Desktop.
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
const ArticleView = () => { | |
const { loading, error, data } = useResource<Article>('/article/1'); | |
if (loading) return <p>Loading…</p>; | |
if (error) return <div class="error">{error.message}</div>; | |
return ( | |
<article> | |
<h1>{data.title}</h1> | |
<p>{data.body}</p> | |
</article> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment