When building a frontend application we usually want to interact with some data from a server. Let's build an application which loads jokes from a server and display them for our users.
Create an application which loads jokes from the backend and display them in the browser. We can random jokes from this joke api. Create an application that has three Tabs, one for "General" jokes, one for "Programming" jokes and one for "Knock-knock" jokes. From the API fetch a joke every time the user switches a tab. Make sure you don't introduce any memory leaks and clean any idle callback functions before unmounting a component.
- Does the application display has three tabs which display three different types of jokes
- Does the application clean up any memory leaks
None, other than using React.
api: https://github.com/15Dkatz/official_joke_api
fetch('https://official-joke-api.appspot.com/jokes/general/random')
.then(res => res.json())
.then(data => console.log(data))