Created
December 19, 2022 17:43
-
-
Save deleteman/92215808c9c1a920d1308a0f5c632920 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
async function getActivity() { | |
let result = await fetch("https://www.boredapi.com/api/activity?type=recreational") | |
const obj = await result.json() | |
return { activity: obj.activity } | |
} | |
export default async function Bored () { | |
let activity = await getActivity(); | |
return ( | |
<div><h1> | |
Your activity | |
</h1> | |
<p> | |
{activity.activity} | |
</p> | |
</div>) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment