Last active
October 24, 2018 20:30
-
-
Save jepras/22e2de834a97d2cd250615fb383e5fd4 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
return ( | |
<ul> | |
{items.map(item => ( | |
<li key={item.ID}> | |
{item.title} | |
{item.content} | |
</li> | |
))} | |
</ul> | |
); | |
if (error) { | |
return <div>Error: {error.message}</div>; | |
} else if (!isLoaded) { | |
return <div>Loading...</div>; | |
} else { | |
return ( | |
<ul> | |
{items.map(item => ( | |
<li key={item.ID}> | |
{item.title} | |
{item.content} | |
</li> | |
))} | |
</ul> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment