Latest solutions
Fylo landing page developed with React
#react#react-testing-library#tailwind-cssSubmitted about 2 years agoSpace Tourism multipage website, developed with React and TypeScript
#react#styled-components#typescript#react-routerSubmitted over 2 years agoSunny Agency landing page, developed with React and TypeScript
#react#typescript#viteSubmitted over 2 years agoURL Shortening API, developed with React and TypeScript
#accessibility#react#typescript#styled-componentsSubmitted over 2 years ago
Latest comments
- @iflucian@YerikAH
Hello!! 👋
You can add this:
const response= await fetch(urlAPI, { method: "GET", cache: "no cache", });
The above code is so that it does not cache the tips, it seems that when I click on the button it only gives me a tip. Although this can also be solved by changing the url to
https://api.adviceslip.com/advice/${id}
, and for each request they can change the id with a random number.You can also implement an error handler, in case there is an error in the API.
try { const response = await fetch(urlAPI, { method: "GET", cache: "no-cache", }); if(!response.ok){ throw { // } } } catch (err) { // }
Hope am helpful.
Good job for completing this challenge.
Marked as helpful