Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Advice generator app build with React and CSS

#react#axios
PTMeen 150

@PTMeen

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


I notched some times we get the same advice in a row. Is there a way to ensure we get different advice every time we make an API call?

Any feedback is appreciated 👏

Community feedback

Faris P 2,810

@FarisPalayi

Posted

I think it might be because of browser caching (not completely sure). To disable it in Axios, disable it in the header like this

axios.get('https://api.adviceslip.com/advice', { headers: { "Cache-Control": "no-cache" } })

Have fun coding ✨

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord